Merge pull request 'projects/mesxc-dy' (#352) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #352
This commit is contained in:
commit
ed3ea7dde8
4
.env.dev
4
.env.dev
@ -1,8 +1,8 @@
|
||||
###
|
||||
# @Author: zhp
|
||||
# @Date: 2024-04-12 14:30:48
|
||||
# @LastEditTime: 2024-04-23 15:43:31
|
||||
# @LastEditors: zhp
|
||||
# @LastEditTime: 2024-04-23 17:25:25
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-30 14:37:28
|
||||
* @LastEditTime: 2024-04-19 17:13:24
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -65,4 +65,13 @@ export function getCoreDepartmentList(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 设备获得所有列表
|
||||
export function getDepartmentList(query) {
|
||||
return request({
|
||||
url: '/system/dept/list-all-simple',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-25 15:44:49
|
||||
* @LastEditTime: 2024-04-22 15:04:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -165,7 +165,7 @@ import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { getDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
@ -289,7 +289,7 @@ export default {
|
||||
return item
|
||||
}) || [];
|
||||
// 部门列表
|
||||
const res1 = await getCoreDepartmentList();
|
||||
const res1 = await getDepartmentList();
|
||||
this.departmentOptions = res1.data || []
|
||||
// 巡检人
|
||||
let inspectorList = [];
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-15 18:38:52
|
||||
* @LastEditTime: 2024-04-22 14:56:03
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -99,7 +99,7 @@ import {
|
||||
createCheckOrder,
|
||||
updateCheckOrder,
|
||||
} from '@/api/equipment/base/inspection/settings';
|
||||
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
|
||||
import { getDepartmentList } from '@/api/base/coreDepartment';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
// import { getEquipmentAll } from '@/api/base/equipment'
|
||||
@ -195,7 +195,7 @@ export default {
|
||||
},
|
||||
async getDict() {
|
||||
// 部门列表
|
||||
const res = await getCoreDepartmentList();
|
||||
const res = await getDepartmentList();
|
||||
this.departmentOptions = res.data || [];
|
||||
const res1 = await groupClassesListAll();
|
||||
this.groupOptions =
|
||||
|
@ -320,7 +320,7 @@ export default {
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'/system/dept/list-all-simple',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
|
@ -540,7 +540,7 @@ export default {
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'system/dept/list-all-simple',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
|
@ -609,7 +609,7 @@ export default {
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'/system/dept/list-all-simple',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 15:55:36
|
||||
* @LastEditTime: 2024-04-19 17:13:45
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -114,7 +114,7 @@
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
|
||||
import { getWorkerList } from '@/api/base/worker'
|
||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { getDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
async getDict() {
|
||||
// 部门列表
|
||||
this.menuOptions = []
|
||||
const res = await getCoreDepartmentList();
|
||||
const res = await getDepartmentList();
|
||||
this.departmentlList = res.data.map(item => {
|
||||
item.parentId = item.parentId ? item.parentId : 0
|
||||
return item
|
||||
|
@ -25,6 +25,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="重置方式" prop="resetMethod" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="dataForm.resetMethod">
|
||||
<el-radio :label="0">自动</el-radio>
|
||||
<el-radio :label="1">手动</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检测内容" prop="inspectionDetIdList"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
|
||||
@ -109,6 +117,7 @@ export default {
|
||||
sectionId: null,
|
||||
productionLineId: null,
|
||||
inspectionDetIdList:[],
|
||||
resetMethod: 0
|
||||
},
|
||||
disabled:false,
|
||||
formLoading: true,
|
||||
@ -143,7 +152,7 @@ export default {
|
||||
methods: {
|
||||
init(obj) {
|
||||
// console.log(productionLineId);
|
||||
console.log(obj)
|
||||
console.log('你好打印', obj)
|
||||
this.getProductionLineList()
|
||||
this.getQualityInspectionDetList()
|
||||
this.visible = true
|
||||
@ -162,6 +171,7 @@ export default {
|
||||
console.log(res);
|
||||
this.dataForm.inspectionDetIdList = res.data
|
||||
this.dataForm.productionLineId = obj.productionLineId
|
||||
this.dataForm.resetMethod = obj.resetMethod
|
||||
this.getWorksectionList(obj.productionLineId)
|
||||
this.dataForm.sectionId = obj.sectionId
|
||||
})
|
||||
|
@ -151,7 +151,8 @@ export default {
|
||||
productionLineId:item.productionLineId,
|
||||
productionLineName:item.productionLineName,
|
||||
sectionId: item.sectionId,
|
||||
sectionName: item.sectionName
|
||||
sectionName: item.sectionName,
|
||||
resetMethod: item.resetMethod
|
||||
}
|
||||
})
|
||||
this.listQuery.total = response.data.total;
|
||||
|
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user