生产数据汇总表
This commit is contained in:
		
							
								
								
									
										141
									
								
								src/views/report/Product/monthly.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								src/views/report/Product/monthly.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,141 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-23 17:06:16
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="weekly">
 | 
			
		||||
    <el-form :inline="true" :model="listQuery" class="blueTip">
 | 
			
		||||
      <el-form-item label="月" prop="reportTime">
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
 | 
			
		||||
    <proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import monthWeek from '../glass/month.vue'
 | 
			
		||||
import proMonth from '../productionMonthReport/index.vue'
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { monthWeek, proMonth },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      listQuery: {
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 4,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
      startTimeStamp: '',
 | 
			
		||||
      endTimeStamp: '',
 | 
			
		||||
      reportTime: '',
 | 
			
		||||
      glassWeekShow: false,
 | 
			
		||||
      proWeekShow: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getCurrentMonthFirst()
 | 
			
		||||
    this.glassWeekShow = true
 | 
			
		||||
    this.proWeekShow = true
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getCurrentMonthFirst() {
 | 
			
		||||
      const date = new Date();
 | 
			
		||||
      date.setDate(1);
 | 
			
		||||
      this.reportTime = date
 | 
			
		||||
      // console.log(date)
 | 
			
		||||
      this.changeTime(date)
 | 
			
		||||
      // console.log(date.valueOf());
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['monthWeek'].handleExport()
 | 
			
		||||
        this.$refs['proMonth'].handleExport()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    search() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['monthWeek'].getDataList()
 | 
			
		||||
        this.$refs['proMonth'].getDataList()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    changeTime(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
			if(val) {
 | 
			
		||||
					const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
 | 
			
		||||
					const fullyear = val.getFullYear()
 | 
			
		||||
					let days = 0
 | 
			
		||||
					switch (timeStamp) {
 | 
			
		||||
            case 0:
 | 
			
		||||
            case 2:
 | 
			
		||||
            case 4:
 | 
			
		||||
            case 6:
 | 
			
		||||
            case 7:
 | 
			
		||||
            case 9:
 | 
			
		||||
            case 11:
 | 
			
		||||
							days = 31
 | 
			
		||||
							break
 | 
			
		||||
            case 3:
 | 
			
		||||
            case 4:
 | 
			
		||||
            case 8:
 | 
			
		||||
            case 10:
 | 
			
		||||
							days = 30
 | 
			
		||||
							break
 | 
			
		||||
						case 1:
 | 
			
		||||
							if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
 | 
			
		||||
								days = 29
 | 
			
		||||
							} else {
 | 
			
		||||
								days = 28
 | 
			
		||||
              }
 | 
			
		||||
              break
 | 
			
		||||
					}
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //结束时间
 | 
			
		||||
					console.log(this.startTimeStamp, this.endTimeStamp)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
					this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
			} else {
 | 
			
		||||
					this.listQuery.reportTime = []
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
    //时间戳转为yy-mm-dd hh:mm:ss
 | 
			
		||||
		timeFun(unixtimestamp) {
 | 
			
		||||
				var unixtimestamp = new Date(unixtimestamp);
 | 
			
		||||
				var year = 1900 + unixtimestamp.getYear();
 | 
			
		||||
				var month = "0" + (unixtimestamp.getMonth() + 1);
 | 
			
		||||
				var date = "0" + unixtimestamp.getDate();
 | 
			
		||||
				return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
		}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
  padding-top: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before{
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  content: '';
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
  margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										171
									
								
								src/views/report/Product/weekly.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										171
									
								
								src/views/report/Product/weekly.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,171 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-23 15:43:36
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="weekly">
 | 
			
		||||
    <el-form :inline="true" :model="listQuery" class="blueTip">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <glassWeek v-if="glassWeekShow" ref="glassWeek" :product="false" :params="listQuery" />
 | 
			
		||||
    <proWeek v-if="proWeekShow" ref="proWeek" :product="false" :params="listQuery" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import glassWeek from '../glass/weekly.vue'
 | 
			
		||||
import proWeek from '../productionWeekReport/index.vue'
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { glassWeek, proWeek },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      listQuery: {
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 3,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
      startTimeStamp: '',
 | 
			
		||||
      endTimeStamp: '',
 | 
			
		||||
      reportTime: '',
 | 
			
		||||
      glassWeekShow: false,
 | 
			
		||||
      proWeekShow: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
    this.glassWeekShow = true
 | 
			
		||||
    this.proWeekShow = true
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['glassWeek'].handleExport()
 | 
			
		||||
        this.$refs['proWeek'].handleExport()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    search() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['glassWeek'].getDataList()
 | 
			
		||||
        this.$refs['proWeek'].getDataList()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    changeTime(val) {
 | 
			
		||||
      console.log(val);
 | 
			
		||||
			if(val) {
 | 
			
		||||
					let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
 | 
			
		||||
					this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间
 | 
			
		||||
					this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间
 | 
			
		||||
					console.log(this.startTimeStamp, this.endTimeStamp)
 | 
			
		||||
				this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
			} else {
 | 
			
		||||
					this.listQuery.reportTime = []
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
    getCurrentWeekStartTimeAndEndTime() {
 | 
			
		||||
      this.reportTime = new Date()
 | 
			
		||||
      var weekday = new Array(7);
 | 
			
		||||
      weekday[0] = "Sunday";
 | 
			
		||||
      weekday[1] = "Monday";
 | 
			
		||||
      weekday[2] = "Tuesday";
 | 
			
		||||
      weekday[3] = "Wednesday";
 | 
			
		||||
      weekday[4] = "Thursday";
 | 
			
		||||
      weekday[5] = "Friday";
 | 
			
		||||
      weekday[6] = "Saturday";
 | 
			
		||||
      // console.log(weekday[this.reportTime.getDay()]);
 | 
			
		||||
      if (weekday[this.reportTime.getDay()] === 'Monday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Thursday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime())
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Friday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Saturday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Sunday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //时间戳转为yy-mm-dd hh:mm:ss
 | 
			
		||||
		timeFun(unixtimestamp) {
 | 
			
		||||
				var unixtimestamp = new Date(unixtimestamp);
 | 
			
		||||
				var year = 1900 + unixtimestamp.getYear();
 | 
			
		||||
				var month = "0" + (unixtimestamp.getMonth() + 1);
 | 
			
		||||
				var date = "0" + unixtimestamp.getDate();
 | 
			
		||||
				return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
		}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
  padding-top: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before{
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  content: '';
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
  margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										117
									
								
								src/views/report/Product/year.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								src/views/report/Product/year.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,117 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-23 17:16:11
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="weekly">
 | 
			
		||||
    <el-form :inline="true" :model="listQuery" class="blueTip">
 | 
			
		||||
      <el-form-item label="年" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
            :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
            style="width: 350px" placeholder="选择年">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <glassYear v-if="glassYearShow" ref="glassYear" :product="false" :params="listQuery" />
 | 
			
		||||
    <proYear v-if="proYearShow" ref="proYear" :product="false" :params="listQuery" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import glassYear from '../glass/year.vue'
 | 
			
		||||
import proYear from '../productionYearReport/index.vue'
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { glassYear, proYear },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      listQuery: {
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 5,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
      startTimeStamp: '',
 | 
			
		||||
      endTimeStamp: '',
 | 
			
		||||
      reportTime: '',
 | 
			
		||||
      glassYearShow: false,
 | 
			
		||||
      proYearShow: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getCurrentYearFirst()
 | 
			
		||||
    this.glassYearShow = true
 | 
			
		||||
    this.proYearShow = true
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['glassYear'].handleExport()
 | 
			
		||||
        this.$refs['proYear'].handleExport()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    search() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['glassYear'].getDataList()
 | 
			
		||||
        this.$refs['proYear'].getDataList()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    changeTime(val) {
 | 
			
		||||
			if(val) {
 | 
			
		||||
					// let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date(val.getFullYear(),11, 31, 7, 0, 0).getTime()); //开始时间
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
			} else {
 | 
			
		||||
					this.listQuery.reportTime = []
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
    getCurrentYearFirst() {
 | 
			
		||||
      let date = new Date();
 | 
			
		||||
      date.setDate(1);
 | 
			
		||||
      date.setMonth(0);
 | 
			
		||||
      this.reportTime = date;
 | 
			
		||||
      this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1,7,0,1).getTime()); //开始时间
 | 
			
		||||
      this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
 | 
			
		||||
      this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
      this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
 | 
			
		||||
    },
 | 
			
		||||
    //时间戳转为yy-mm-dd hh:mm:ss
 | 
			
		||||
		timeFun(unixtimestamp) {
 | 
			
		||||
				var unixtimestamp = new Date(unixtimestamp);
 | 
			
		||||
				var year = 1900 + unixtimestamp.getYear();
 | 
			
		||||
				var month = "0" + (unixtimestamp.getMonth() + 1);
 | 
			
		||||
				var date = "0" + unixtimestamp.getDate();
 | 
			
		||||
				return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
		},
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
  padding-top: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before{
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  content: '';
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
  margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-12-13 14:10:04
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:21:34
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-23 16:47:21
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
    <el-row v-if="isShowEdit" style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="edit = true">编辑</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
@@ -152,6 +152,10 @@ const cols = [
 | 
			
		||||
      type: {
 | 
			
		||||
        type: Number,
 | 
			
		||||
        default: 3,
 | 
			
		||||
      },
 | 
			
		||||
      isShowEdit: {
 | 
			
		||||
        type: Boolean,
 | 
			
		||||
        default: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
@@ -174,8 +178,9 @@ const cols = [
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        deep: true,
 | 
			
		||||
        handler(newv, oldv) {
 | 
			
		||||
          if (newv[0] !== '') {
 | 
			
		||||
          if (newv[0] !== '' && newv[0] !== undefined) {
 | 
			
		||||
            this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          } else {
 | 
			
		||||
            this.cols[0].label = this.date
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="月" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
@@ -33,6 +33,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -40,9 +50,6 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				reportType: 4,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -101,6 +108,9 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
       if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" /> -->
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="周" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -35,6 +35,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -42,9 +52,6 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				reportType: 3,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -89,11 +96,12 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  created () {
 | 
			
		||||
    // this.getDict()
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
  },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		// const day = new Date().getDay()
 | 
			
		||||
    // console.log('周四', day)
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
    // this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
		// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
	},
 | 
			
		||||
@@ -190,6 +198,10 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
        // this.$set(this.listQuery, 'reportTime', this.params.reportTime)
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="年" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -30,6 +30,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -37,9 +47,9 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 5,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -54,11 +64,10 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
  created() {
 | 
			
		||||
		// this.getDict()
 | 
			
		||||
    this.getCurrentYearFirst()
 | 
			
		||||
  },
 | 
			
		||||
  mounted () {
 | 
			
		||||
    this.getCurrentYearFirst()
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
      ;
 | 
			
		||||
    this.getDataList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getCurrentYearFirst() {
 | 
			
		||||
@@ -101,6 +110,9 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,29 +1,31 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:46
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-23 16:58:06
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item label="月" prop="reportTime">
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="月" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
@@ -286,6 +288,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -653,16 +665,21 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.monthValue.length > 0) {
 | 
			
		||||
        console.log(this.monthValue)
 | 
			
		||||
        this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
        this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.timeTips);
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
        // return false
 | 
			
		||||
        if (this.monthValue.length > 0) {
 | 
			
		||||
          console.log(this.monthValue)
 | 
			
		||||
          this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
          // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
          this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
          this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
          console.log(this.timeTips);
 | 
			
		||||
        } else {
 | 
			
		||||
          // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
          // return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,31 +1,33 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-23 16:58:12
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
            :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
            style="width: 350px" placeholder="选择周">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
@@ -292,6 +294,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -622,11 +634,16 @@ export default {
 | 
			
		||||
      return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
        this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
          this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
          // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
          this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
        } else {
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +1,35 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:54
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-23 17:21:04
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择年">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
      <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
            :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
            style="width: 350px" placeholder="选择年">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
        <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
@@ -294,6 +296,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -556,15 +568,20 @@ export default {
 | 
			
		||||
      return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
 | 
			
		||||
      console.log(this.yearValue1);
 | 
			
		||||
      if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
        if (this.yearValue2 < this.yearValue1) {
 | 
			
		||||
          this.$modal.msgError('结束时间不能早于开始时间')
 | 
			
		||||
          return false
 | 
			
		||||
        } else {
 | 
			
		||||
          // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
 | 
			
		||||
          // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.yearValue1);
 | 
			
		||||
        if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
          if (this.yearValue2 < this.yearValue1) {
 | 
			
		||||
            this.$modal.msgError('结束时间不能早于开始时间')
 | 
			
		||||
            return false
 | 
			
		||||
          } else {
 | 
			
		||||
            // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
 | 
			
		||||
            // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user