projects/mesxc-zjl #353

Merged
juzi merged 2 commits from projects/mesxc-zjl into projects/mesxc-test 2024-04-24 13:32:27 +08:00
23 changed files with 737 additions and 150 deletions
Showing only changes of commit 4b01dd3ec3 - Show all commits

View File

@ -1,8 +1,8 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-12 14:30:48 # @Date: 2024-04-12 14:30:48
# @LastEditTime: 2024-04-23 13:52:57 # @LastEditTime: 2024-04-23 17:25:25
# @LastEditors: zhp # @LastEditors: DY
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
@ -12,10 +12,10 @@ ENV = 'development'
VUE_APP_TITLE = MES系统 VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://10.70.2.2:8080' # VUE_APP_BASE_API = 'http://192.168.4.176:48082'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' VUE_APP_JIMU_API = 'http://192.168.1.101:48082'
# socket地址(现场) # socket地址(现场)
VUE_APP_Socket_API = 'ws://10.70.2.2:8080' VUE_APP_Socket_API = 'ws://10.70.2.2:8080'

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28 * @LastEditTime: 2024-04-19 17:13:24
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -66,3 +66,12 @@ export function getCoreDepartmentList(query) {
params: query params: query
}) })
} }
// 设备获得所有列表
export function getDepartmentList(query) {
return request({
url: '/system/dept/list-all-simple',
method: 'get',
params: query
})
}

View File

@ -2,7 +2,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-23 14:04:24 * @LastEditTime: 2024-04-23 15:34:56
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -83,6 +83,9 @@ export default {
this.chart = null this.chart = null
}, },
methods: { methods: {
// getNumLength(num) {
// return num.toString().length;
// },
initChart(nameList, passRateList, outputNumList) { initChart(nameList, passRateList, outputNumList) {
console.log(nameList, passRateList) console.log(nameList, passRateList)
let series= [ let series= [
@ -218,11 +221,10 @@ export default {
// }, // },
yAxis: [ yAxis: [
{ {
min: function() { // min: function () { //
return 0 return 0
}, },
max: function(value) { // max: function (value) { //
return Math.ceil(value.max)
}, },
scale: true, scale: true,
type: 'value', type: 'value',
@ -266,8 +268,16 @@ export default {
// }, // },
}, },
{ {
min: 0, min: function () { //
max: 100000, return 0
},
max: function (value) { //
// console.log(value.max.toString().length)
// String(value.max)[0]
// for
// return String(value.max)[0] +
},
minInterval: 5,// minInterval: 5,//
scale: true, scale: true,
type: 'value', type: 'value',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-23 14:06:05 * @LastEditTime: 2024-04-23 15:36:35
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -217,12 +217,11 @@ export default {
// }, // },
yAxis: [ yAxis: [
{ {
// min: function() { // min: function () { //
// return 0 return 0
// }, },
// max: function(value) { // max: function (value) { //
// return Math.ceil(value.max) },
// },
scale: true, scale: true,
type: 'value', type: 'value',
name: '良品率/%', name: '良品率/%',
@ -265,8 +264,16 @@ export default {
// }, // },
}, },
{ {
min: 0, min: function () { //
max: 100000, return 0
},
max: function (value) { //
// console.log(value.max.toString().length)
// String(value.max)[0]
// for
// return String(value.max)[0] +
},
minInterval: 5,// minInterval: 5,//
scale: true, scale: true,
type: 'value', type: 'value',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-25 15:44:49 * @LastEditTime: 2024-04-22 15:04:40
* @Description: * @Description:
--> -->
<template> <template>
@ -165,7 +165,7 @@ import SmallTitle from './SmallTitle';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import attrAdd from './attr-add'; import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; 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 { groupClassesListAll } from '@/api/monitoring/teamProduction'
import { getDictDataLabel } from '@/utils/dict'; import { getDictDataLabel } from '@/utils/dict';
@ -289,7 +289,7 @@ export default {
return item return item
}) || []; }) || [];
// //
const res1 = await getCoreDepartmentList(); const res1 = await getDepartmentList();
this.departmentOptions = res1.data || [] this.departmentOptions = res1.data || []
// //
let inspectorList = []; let inspectorList = [];

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-15 18:38:52 * @LastEditTime: 2024-04-22 14:56:03
* @Description: * @Description:
--> -->
<template> <template>
@ -99,7 +99,7 @@ import {
createCheckOrder, createCheckOrder,
updateCheckOrder, updateCheckOrder,
} from '@/api/equipment/base/inspection/settings'; } 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 { groupClassesListAll } from '@/api/monitoring/teamProduction';
import { getDictDataLabel } from '@/utils/dict'; import { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment' // import { getEquipmentAll } from '@/api/base/equipment'
@ -195,7 +195,7 @@ export default {
}, },
async getDict() { async getDict() {
// //
const res = await getCoreDepartmentList(); const res = await getDepartmentList();
this.departmentOptions = res.data || []; this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll(); const res1 = await groupClassesListAll();
this.groupOptions = this.groupOptions =

View File

@ -320,7 +320,7 @@ export default {
async getList(source = 'department') { async getList(source = 'department') {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', '/system/dept/list-all-simple',
'/base/core-worker/listAll', '/base/core-worker/listAll',
]; ];
let res; let res;

View File

@ -540,7 +540,7 @@ export default {
async getList(source = 'department') { async getList(source = 'department') {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', 'system/dept/list-all-simple',
'/base/core-worker/listAll', '/base/core-worker/listAll',
]; ];
let res; let res;

View File

@ -609,7 +609,7 @@ export default {
async getList(source = 'department') { async getList(source = 'department') {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', '/system/dept/list-all-simple',
'/base/core-worker/listAll', '/base/core-worker/listAll',
]; ];
let res; let res;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-13 15:55:36 * @LastEditTime: 2024-04-19 17:13:45
* @Description: * @Description:
--> -->
<template> <template>
@ -114,7 +114,7 @@
import basicAdd from '../../../../core/mixins/basic-add'; import basicAdd from '../../../../core/mixins/basic-add';
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct"; // import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import { getWorkerList } from '@/api/base/worker' 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 { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import { parseTime } from '../../../../core/mixins/code-filter'; import { parseTime } from '../../../../core/mixins/code-filter';
@ -175,7 +175,7 @@ export default {
async getDict() { async getDict() {
// //
this.menuOptions = [] this.menuOptions = []
const res = await getCoreDepartmentList(); const res = await getDepartmentList();
this.departmentlList = res.data.map(item => { this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0 item.parentId = item.parentId ? item.parentId : 0
return item return item

View File

@ -25,6 +25,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-col :span="24">
<el-form-item label="检测内容" prop="inspectionDetIdList" <el-form-item label="检测内容" prop="inspectionDetIdList"
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]"> :rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
@ -109,6 +117,7 @@ export default {
sectionId: null, sectionId: null,
productionLineId: null, productionLineId: null,
inspectionDetIdList:[], inspectionDetIdList:[],
resetMethod: 0
}, },
disabled:false, disabled:false,
formLoading: true, formLoading: true,
@ -143,7 +152,7 @@ export default {
methods: { methods: {
init(obj) { init(obj) {
// console.log(productionLineId); // console.log(productionLineId);
console.log(obj) console.log('你好打印', obj)
this.getProductionLineList() this.getProductionLineList()
this.getQualityInspectionDetList() this.getQualityInspectionDetList()
this.visible = true this.visible = true
@ -162,6 +171,7 @@ export default {
console.log(res); console.log(res);
this.dataForm.inspectionDetIdList = res.data this.dataForm.inspectionDetIdList = res.data
this.dataForm.productionLineId = obj.productionLineId this.dataForm.productionLineId = obj.productionLineId
this.dataForm.resetMethod = obj.resetMethod
this.getWorksectionList(obj.productionLineId) this.getWorksectionList(obj.productionLineId)
this.dataForm.sectionId = obj.sectionId this.dataForm.sectionId = obj.sectionId
}) })

View File

@ -151,7 +151,8 @@ export default {
productionLineId:item.productionLineId, productionLineId:item.productionLineId,
productionLineName:item.productionLineName, productionLineName:item.productionLineName,
sectionId: item.sectionId, sectionId: item.sectionId,
sectionName: item.sectionName sectionName: item.sectionName,
resetMethod: item.resetMethod
} }
}) })
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;

View 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>

View 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>

View 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>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-12-13 14:10:04 * @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-04-12 14:21:34 * @LastEditTime: 2024-04-23 16:47:21
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div> <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" <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
size="small" @click="edit = true">编辑</el-button> size="small" @click="edit = true">编辑</el-button>
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
@ -152,6 +152,10 @@ const cols = [
type: { type: {
type: Number, type: Number,
default: 3, default: 3,
},
isShowEdit: {
type: Boolean,
default: true
} }
}, },
data() { data() {
@ -174,8 +178,9 @@ const cols = [
}, },
time: { time: {
immediate: true, immediate: true,
deep: true,
handler(newv, oldv) { handler(newv, oldv) {
if (newv[0] !== '') { if (newv[0] !== '' && newv[0] !== undefined) {
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')' this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
} else { } else {
this.cols[0].label = this.date this.cols[0].label = this.date

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <div v-if="product">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="月" prop="reportTime"> <el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
@ -14,7 +14,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </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" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
<!-- <pagination <!-- <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
@ -33,6 +33,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -40,9 +50,6 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
reportType: 4, reportType: 4,
reportTime: [] reportTime: []
}, },
@ -101,6 +108,9 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -4,7 +4,7 @@
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> --> @headBtnClick="buttonClick" /> -->
<div> <div v-if="product">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="周" prop="reportTime"> <el-form-item label="周" prop="reportTime">
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
@ -21,7 +21,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </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" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -35,6 +35,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -42,9 +52,6 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
reportType: 3, reportType: 3,
reportTime: [] reportTime: []
}, },
@ -89,11 +96,12 @@ export default {
}, },
created () { created () {
// this.getDict() // this.getDict()
this.getCurrentWeekStartTimeAndEndTime()
}, },
mounted() { mounted() {
// const day = new Date().getDay() // const day = new Date().getDay()
// console.log('', day) // console.log('', day)
this.getCurrentWeekStartTimeAndEndTime() // this.getCurrentWeekStartTimeAndEndTime()
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000)) // this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
this.getDataList() this.getDataList()
}, },
@ -190,6 +198,10 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
// this.$set(this.listQuery, 'reportTime', this.params.reportTime)
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <div v-if="product">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="年" prop="reportTime"> <el-form-item label="年" prop="reportTime">
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
@ -16,7 +16,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </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" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -30,6 +30,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -37,9 +47,9 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10, // pageSize: 10,
pageNo: 1, // pageNo: 1,
total: 0, // total: 0,
reportType: 5, reportType: 5,
reportTime: [] reportTime: []
}, },
@ -54,11 +64,10 @@ export default {
}, },
created() { created() {
// this.getDict() // this.getDict()
this.getCurrentYearFirst()
}, },
mounted () { mounted () {
this.getCurrentYearFirst() this.getDataList();
this.getDataList()
;
}, },
methods: { methods: {
getCurrentYearFirst() { getCurrentYearFirst() {
@ -101,6 +110,9 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 14:08:46 * @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-23 15:23:05 * @LastEditTime: 2024-04-23 16:18:27
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -35,7 +35,7 @@
<el-table-column prop="activityName"></el-table-column> <el-table-column prop="activityName"></el-table-column>
<el-table-column prop="message"></el-table-column> <el-table-column prop="message"></el-table-column>
</el-table-column> --> </el-table-column> -->
<el-table-column v-for="(item,index) in codeList " :prop="item" :label="item"> <el-table-column style="text-align: center;" v-for="(item,index) in codeList " :prop="item" :label="item">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<el-col :span="12"> <el-col :span="12">
{{ codeList[index] }} {{ codeList[index] }}
@ -127,7 +127,7 @@ export default {
// deleteURL: deleteQualityHotMaterial, // deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14' ], codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'],
tableData: [], tableData: [],
listQuery: { listQuery: {
startTime: undefined, startTime: undefined,
@ -211,7 +211,7 @@ export default {
} }
} }
} }
if (columnIndex === 1 || columnIndex === 2 || columnIndex === 3 || columnIndex === 4 || columnIndex === 5 || columnIndex === 6) { if (columnIndex === 1) {
if (rowIndex === 1 || rowIndex === 3 || rowIndex === 5 || rowIndex === 7 || rowIndex === 9 || rowIndex === 11) { if (rowIndex === 1 || rowIndex === 3 || rowIndex === 5 || rowIndex === 7 || rowIndex === 9 || rowIndex === 11) {
return { return {
rowspan: 1, rowspan: 1,
@ -219,6 +219,14 @@ export default {
} }
} }
} }
if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13) {
if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) {
return {
rowspan: 2,
colspan: 1
}
}
}
}, },
handleExport() { handleExport() {
// //
@ -266,8 +274,8 @@ export default {
// //
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.listQuery.startTime = '1713197388000'; // this.listQuery.startTime = '1713197388000';
this.listQuery.endTime = '1713254961000'; // this.listQuery.endTime = '1713254961000';
this.urlOptions.getDataListURL(this.listQuery).then(res => { this.urlOptions.getDataListURL(this.listQuery).then(res => {
// console.log(res) // console.log(res)
// console.log(res.data) // console.log(res.data)
@ -304,6 +312,7 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2': null,
putType: '' putType: ''
}, },
{ {
@ -338,6 +347,7 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2': null,
putType: '' putType: ''
}, },
{ {
@ -372,6 +382,7 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2': null,
putType: '' putType: ''
}, },
{ {
@ -406,6 +417,7 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2': null,
putType: '' putType: ''
}, },
{ {
@ -440,6 +452,7 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2':null,
putType: '' putType: ''
}, },
{ {
@ -474,10 +487,27 @@ export default {
'sj12': null, 'sj12': null,
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
'sj1+sj2': null,
putType: '' putType: ''
}, },
] ]
res.data.forEach((ele) => { res.data.forEach((ele) => {
if(ele.classType === 1 && ele.code == 'sj1+sj2') {
arr[1]['putType'] = ele.putNum
arr[3]['putType'] = ele.useNum
// arr[1]['sj2'] = ele.putNum
// arr[3]['sj2'] = ele.useNum
} else if (ele.classType === 2 && ele.code == 'sj1+sj2') {
arr[5]['putType'] = ele.putNum
arr[7]['putType'] = ele.useNum
// arr[5]['sj2'] = ele.putNum
// arr[7]['sj2'] = ele.useNum
} else if (ele.classType === 3 && ele.code == 'sj1+sj2') {
arr[9]['putType'] = ele.putNum
arr[11]['putType'] = ele.useNum
// arr[9]['sj2'] = ele.putNum
// arr[11]['sj2'] = ele.useNum
}
this.codeList.forEach((item) => { this.codeList.forEach((item) => {
if (ele.classType === 1 && ele.code == item) { if (ele.classType === 1 && ele.code == item) {
// console.log(arr[0][item]) // console.log(arr[0][item])
@ -494,6 +524,7 @@ export default {
}) })
// console.log(arr) // console.log(arr)
this.tableData = arr this.tableData = arr
console.log(this.tableData);
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },

View File

@ -1,29 +1,31 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:46 * @LastEditTime: 2024-04-23 16:58:06
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <div v-if="product">
<el-form-item label="月" prop="reportTime"> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-form-item label="月" prop="reportTime">
</el-date-picker> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-form-item> </el-date-picker>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()"> </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 </el-button>
@click="handleExport">导出</el-button> <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
</el-form> @click="handleExport">导出</el-button>
<el-row style="float: right; margin-bottom: 5px"> </el-form>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData" <el-row style="float: right; margin-bottom: 5px">
size="small" @click="editDataList()">编辑</el-button> <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> size="small" @click="editDataList()">编辑</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
</el-row> <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="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -286,6 +288,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -653,16 +665,21 @@ export default {
} }
}, },
async getDataList() { async getDataList() {
if (this.monthValue.length > 0) { if (this?.params) {
console.log(this.monthValue) this.dataForm = {...this.params}
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01' this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// 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 { } else {
// this.$modal.msgError('') if (this.monthValue.length > 0) {
// return false 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) { if (this.dataForm.reportTime.length == 0) {
this.$message({ this.$message({

View File

@ -1,31 +1,33 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:51 * @LastEditTime: 2024-04-23 16:58:12
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <div v-if="product">
<el-form-item> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime" <el-form-item>
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp" <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
style="width: 350px" placeholder="选择周"> :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
</el-date-picker> style="width: 350px" placeholder="选择周">
</el-form-item> </el-date-picker>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()"> </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 </el-button>
@click="handleExport">导出</el-button> <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
</el-form> @click="handleExport">导出</el-button>
<el-row style="float: right; margin-bottom: 5px"> </el-form>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData" <el-row style="float: right; margin-bottom: 5px">
size="small" @click="editDataList()">编辑</el-button> <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> size="small" @click="editDataList()">编辑</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
</el-row> <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="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -292,6 +294,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -622,11 +634,16 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}, },
async getDataList() { async getDataList() {
if (this.weekValue1 && this.weekValue2) { if (this?.params) {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01' this.dataForm = {...this.params}
// this.queryParams.startTime = this.monthValue[0] this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
} else { } 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) { if (this.dataForm.reportTime.length == 0) {
this.$message({ this.$message({

View File

@ -1,33 +1,35 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:54 * @LastEditTime: 2024-04-23 17:21:04
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <div v-if="product">
<el-form-item> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime" <el-form-item>
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp" <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
style="width: 350px" placeholder="选择年"> :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
</el-date-picker> style="width: 350px" placeholder="选择年">
</el-form-item> </el-date-picker>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()"> </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 </el-button>
@click="handleExport">导出</el-button> <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button> @click="handleExport">导出</el-button>
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> --> <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
</el-form> <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
<el-row style="float: right; margin-bottom: 5px"> </el-form>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData" <el-row style="float: right; margin-bottom: 5px">
size="small" @click="editDataList()">编辑</el-button> <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> size="small" @click="editDataList()">编辑</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
</el-row> <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="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -294,6 +296,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -556,15 +568,20 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}, },
async getDataList() { async getDataList() {
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD') if (this?.params) {
console.log(this.yearValue1); this.dataForm = {...this.params}
if (this.yearValue1 && this.yearValue2) { this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
if (this.yearValue2 < this.yearValue1) { } else {
this.$modal.msgError('结束时间不能早于开始时间') this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
return false console.log(this.yearValue1);
} else { if (this.yearValue1 && this.yearValue2) {
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1) if (this.yearValue2 < this.yearValue1) {
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2) 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) { if (this.dataForm.reportTime.length == 0) {