Merge pull request 'projects/mesxc-zhp' (#232) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #232
This commit is contained in:
commit
354fd488a9
4
.env.dev
4
.env.dev
@ -1,8 +1,8 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-03-01 20:40:47
|
||||
# @LastEditors: DY
|
||||
# @LastEditTime: 2024-03-05 09:48:49
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
|
@ -188,8 +188,8 @@ export default {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.content = val.content ? val.content : undefined;
|
||||
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
||||
// this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-24 15:15:24
|
||||
* @LastEditTime: 2024-01-24 15:38:53
|
||||
* @LastEditTime: 2024-03-05 09:36:28
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -63,8 +63,13 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
this.getTodayStartTimeAndEndTime()
|
||||
},
|
||||
methods: {
|
||||
getTodayStartTimeAndEndTime() {
|
||||
this.reportTime = new Date()
|
||||
this.changeTime(this.reportTime)
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
|
@ -60,6 +60,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCurrentMonthFirst()
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
@ -67,6 +68,14 @@ export default {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
this.proLineList = res.data;
|
||||
},
|
||||
getCurrentMonthFirst() {
|
||||
const date = new Date();
|
||||
date.setDate(1);
|
||||
this.reportTime = date
|
||||
// console.log(date)
|
||||
this.changeTime(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList() {
|
||||
@ -91,23 +100,34 @@ export default {
|
||||
});
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if(val) {
|
||||
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
const fullyear = val.getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0, 2, 4, 6, 7, 9, 11:
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
days = 31
|
||||
break
|
||||
case 3, 4, 8, 10:
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 10:
|
||||
days = 30
|
||||
break
|
||||
case 1:
|
||||
if ((fullyear % 400 === 0) || (fullyear() % 4 === 0 && fullyear() % 100 !== 0)) {
|
||||
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).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 23, 59, 59).getTime()); //结束时间
|
||||
|
@ -94,6 +94,7 @@ export default {
|
||||
mounted() {
|
||||
// const day = new Date().getDay()
|
||||
// console.log('周四', day)
|
||||
this.getCurrentWeekStartTimeAndEndTime()
|
||||
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
|
||||
this.getDict()
|
||||
},
|
||||
@ -104,6 +105,10 @@ export default {
|
||||
this.proLineList = res.data;
|
||||
// this.getDataList()
|
||||
});
|
||||
},
|
||||
getCurrentWeekStartTimeAndEndTime() {
|
||||
this.reportTime = new Date()
|
||||
this.changeTime(this.reportTime)
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList() {
|
||||
@ -128,6 +133,7 @@ export default {
|
||||
});
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val);
|
||||
if(val) {
|
||||
let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
||||
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间
|
||||
|
@ -60,7 +60,21 @@ export default {
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
mounted () {
|
||||
this.getCurrentYearFirst()
|
||||
;
|
||||
},
|
||||
methods: {
|
||||
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).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间
|
||||
this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 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, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-01 15:26:38
|
||||
* @LastEditTime: 2024-03-05 09:36:18
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker v-model="dataForm.reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -27,26 +27,26 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="lineId" label="生产线">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.lineId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -54,21 +54,21 @@
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
@ -77,19 +77,19 @@
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
@ -98,21 +98,21 @@
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
@ -121,7 +121,9 @@
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
<el-input v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
@ -389,7 +391,8 @@ export default {
|
||||
// remark: undefined,
|
||||
// },
|
||||
// 查询参数
|
||||
dataForm: {
|
||||
reportTime:'',
|
||||
listQuery: {
|
||||
// workOrderIdList:undefined,
|
||||
// productionId: undefined,
|
||||
// startTime: undefined,
|
||||
@ -419,6 +422,7 @@ export default {
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
this.getTodayStartTimeAndEndTime()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
@ -434,22 +438,27 @@ export default {
|
||||
// var s = time.getSeconds();
|
||||
return time
|
||||
},
|
||||
getTodayStartTimeAndEndTime() {
|
||||
this.reportTime = new Date()
|
||||
this.changeTime(this.reportTime)
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if (val) {
|
||||
// console.log(val)
|
||||
// console.log(val.setHours(7, 0, 0))
|
||||
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.dataForm.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.dataForm.reportTime);
|
||||
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.listQuery.reportTime);
|
||||
} else {
|
||||
this.dataForm.reportTime = []
|
||||
this.listQuery.reportTime = []
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
@ -460,36 +469,36 @@ export default {
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
},
|
||||
timeSelect() {
|
||||
// switch (this.queryParams.timeDim) {
|
||||
// case '1':
|
||||
// if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
|
||||
// this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||
// this.timeValue = []
|
||||
// }
|
||||
// break
|
||||
// case '2':
|
||||
if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
|
||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
this.monthValue = []
|
||||
}
|
||||
// break
|
||||
// case '4':
|
||||
// timeSelect() {
|
||||
// // switch (this.queryParams.timeDim) {
|
||||
// // case '1':
|
||||
// // if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
|
||||
// // this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||
// // this.timeValue = []
|
||||
// // }
|
||||
// // break
|
||||
// // case '2':
|
||||
// if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
|
||||
// this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
// this.monthValue = []
|
||||
// }
|
||||
// break
|
||||
// default:
|
||||
},
|
||||
transformTime(timeStamp) {// 本月最后一天
|
||||
let year = moment(timeStamp).format('YYYY')
|
||||
let month = moment(timeStamp).format('MM')
|
||||
let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
let value = newData
|
||||
console.log(value);
|
||||
return value
|
||||
},
|
||||
// // break
|
||||
// // case '4':
|
||||
// // if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
|
||||
// // this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
// // this.monthValue = []
|
||||
// // }
|
||||
// // break
|
||||
// // default:
|
||||
// },
|
||||
// transformTime(timeStamp) {// 本月最后一天
|
||||
// let year = moment(timeStamp).format('YYYY')
|
||||
// let month = moment(timeStamp).format('MM')
|
||||
// let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
// let value = newData
|
||||
// console.log(value);
|
||||
// return value
|
||||
// },
|
||||
// selectTime() {
|
||||
// switch (this.queryParams.type) {
|
||||
// case 1:
|
||||
@ -532,23 +541,23 @@ export default {
|
||||
}
|
||||
},
|
||||
async getDataList() {
|
||||
if (this.monthValue.length > 0) {
|
||||
console.log(this.monthValue)
|
||||
this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
|
||||
// this.queryParams.startTime = this.monthValue[0]
|
||||
this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
|
||||
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.monthValue.length > 0) {
|
||||
// console.log(this.monthValue)
|
||||
// this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0])
|
||||
// // this.queryParams.startTime = this.monthValue[0]
|
||||
// this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1])
|
||||
// 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
|
||||
// }
|
||||
|
||||
console.log(this.dataForm);
|
||||
console.log(this.listQuery);
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
method: 'get',
|
||||
params: this.dataForm
|
||||
params: this.listQuery
|
||||
})
|
||||
console.log(res)
|
||||
// let sum = undefined
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-01-24 15:57:10
|
||||
* @LastEditTime: 2024-03-05 09:06:22
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -10,8 +10,8 @@
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
|
||||
size="small" style='width:350px;' @change="timeSelect">
|
||||
end-placeholder="结束日期" clearable :picker-options="pickerOptions" size="small" style='width:350px;'
|
||||
@change="timeSelect">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -29,26 +29,26 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="lineId" label="生产线">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.lineId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -56,21 +56,21 @@
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
@ -79,19 +79,19 @@
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
@ -100,21 +100,21 @@
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
@ -123,7 +123,9 @@
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
<el-input v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
@ -320,9 +322,9 @@ export default {
|
||||
// },
|
||||
],
|
||||
pickerOptions: {
|
||||
disabledDate(date) {
|
||||
return date.getTime() > Date.now()
|
||||
}
|
||||
// disabledDate(date) {
|
||||
// return date.getTime() > Date.now()
|
||||
// }
|
||||
},
|
||||
// tableBtn: [
|
||||
// this.$auth.hasPermi('base:quality-inspection-record:update')
|
||||
@ -403,6 +405,8 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCurrentMonthFirst()
|
||||
this.getCurrentMonthLast()
|
||||
// this.getProductLineList();
|
||||
},
|
||||
mounted() {
|
||||
@ -421,6 +425,7 @@ export default {
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
@ -437,6 +442,21 @@ export default {
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
},
|
||||
getCurrentMonthFirst() {
|
||||
const date = new Date();
|
||||
date.setDate(1);
|
||||
this.monthValue[0] = moment(date).format('YYYY-MM-DD')
|
||||
console.log(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
getCurrentMonthLast() {
|
||||
const date = new Date();
|
||||
const currentMonth = date.getMonth();
|
||||
const nextMonth = currentMonth + 1;
|
||||
const nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
|
||||
const oneDay = 24 * 60 * 60 * 1000;
|
||||
this.monthValue[1] = new Date(nextMonthFirstDay - oneDay)
|
||||
},
|
||||
timeSelect() {
|
||||
// switch (this.queryParams.timeDim) {
|
||||
// case '1':
|
||||
@ -446,6 +466,7 @@ export default {
|
||||
// }
|
||||
// break
|
||||
// case '2':
|
||||
console.log(this.monthValue[1],this.monthValue[0]);
|
||||
if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
|
||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
this.monthValue = []
|
||||
@ -467,6 +488,14 @@ export default {
|
||||
console.log(value);
|
||||
return value
|
||||
},
|
||||
transformStartTime(timeStamp) {// 本月最后一天
|
||||
let year = moment(timeStamp).format('YYYY')
|
||||
let month = moment(timeStamp).format('MM')
|
||||
let newData = moment(new Date(year, month, 1)).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
let value = newData
|
||||
console.log(value);
|
||||
return value
|
||||
},
|
||||
// selectTime() {
|
||||
// switch (this.queryParams.type) {
|
||||
// case 1:
|
||||
@ -511,9 +540,9 @@ export default {
|
||||
async getDataList() {
|
||||
if (this.monthValue.length > 0) {
|
||||
console.log(this.monthValue)
|
||||
this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
|
||||
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
// this.queryParams.startTime = this.monthValue[0]
|
||||
this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
|
||||
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
|
||||
console.log(this.timeTips);
|
||||
} else {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-01-24 15:50:10
|
||||
* @LastEditTime: 2024-03-04 16:51:18
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
<el-date-picker clearable v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
|
||||
size="small" style='width:350px;' @change="timeSelect">
|
||||
</el-date-picker>
|
||||
@ -29,7 +29,7 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="glassType" label="品种" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.glassType" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.glassType" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.glassType }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -37,19 +37,19 @@
|
||||
<el-table-column label="成品" align="center">
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionL" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.productionL" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionL }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionW" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.productionW" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionW }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionH" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.productionH" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionH }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -57,89 +57,88 @@
|
||||
<el-table-column label="原片">
|
||||
<el-table-column prop="originalGlassSize">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.originalGlassSize" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.originalGlassSize" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.originalGlassSize }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="完成良品产量"> -->
|
||||
<el-table-column prop="customerId" label="用户">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.customerId" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.customerId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageType" label="包装形式">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.packageType" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.packageType" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.packageType }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" label="订单数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderNum" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.orderNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderFinish" label="订单完成">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderFinish" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.orderFinish" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderFinish }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderRemaining" label="未完成订单">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderRemaining" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.orderRemaining" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderRemaining }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stockLastMonth" label="上月库存">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.stockLastMonth" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.stockLastMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.stockLastMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="productNumThisMonth" label="本月生产成品">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productNumThisMonth" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.productNumThisMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.productNumThisMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveNum" label="发货量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveNum" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.deliveNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.deliveNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="undeliveNum" label="未发货量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveNum" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.undeliveNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.undeliveNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="undeliveArea" label="未发货面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveArea" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.undeliveArea" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.undeliveArea }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveArea" label="发货面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveArea" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.deliveArea" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.deliveArea }} </span>
|
||||
</template>
|
||||
@ -147,15 +146,19 @@
|
||||
|
||||
<el-table-column prop="productAreaThisMonth" label="本月生产面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productAreaThisMonth" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.productAreaThisMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.productAreaThisMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- </el-table-column> -->
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
<el-input v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
|
@ -1,37 +0,0 @@
|
||||
<template>
|
||||
<div class="tableInner">
|
||||
<el-input v-model="list[itemProp]" @blur="changeInput" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'InputArea',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
itemProp: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.tableInner .el-input__inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
height: 33px;
|
||||
}
|
||||
</style>
|
@ -1,468 +0,0 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-01-24 15:55:48
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="lineId" label="生产线">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.lineId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
<!-- 列表 -->
|
||||
<!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
|
||||
:table-data="list">
|
||||
</base-table> -->
|
||||
<!-- 分页组件 -->
|
||||
<!-- <pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProductionDataList,
|
||||
updateProductionDataList,
|
||||
updateSumProductionDataList,
|
||||
exportProductExcel
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'lineId',
|
||||
label: '生产线',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: '',
|
||||
label: '投入数㎡',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'inputNow',
|
||||
label: '本周'
|
||||
},
|
||||
{
|
||||
prop: 'inputHis',
|
||||
label: '上周'
|
||||
},
|
||||
{
|
||||
prop: 'inputTrend',
|
||||
label: '增减'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: '',
|
||||
label: '完成良品产量',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'goodProductNow',
|
||||
label: '本周'
|
||||
},
|
||||
{
|
||||
prop: 'goodProductHis',
|
||||
label: '上周'
|
||||
},
|
||||
{
|
||||
prop: 'goodProductTrend',
|
||||
label: '增减'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: '',
|
||||
label: '原片漏检率',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'missCheckNow',
|
||||
label: '本周'
|
||||
},
|
||||
{
|
||||
prop: 'missCheckHis',
|
||||
label: '上周'
|
||||
},
|
||||
{
|
||||
prop: 'missCheckTrend',
|
||||
label: '增减'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: '',
|
||||
label: '综合良品率',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'goodProductPassNow',
|
||||
label: '本周'
|
||||
},
|
||||
{
|
||||
prop: 'goodProductPassHis',
|
||||
label: '上周'
|
||||
},
|
||||
{
|
||||
prop: 'goodProductPassTrend',
|
||||
label: '增减'
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'statisticalData',
|
||||
// components: {
|
||||
// DialogForm,
|
||||
// },
|
||||
// mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
remark: '',
|
||||
urlOptions: {
|
||||
// getDataListURL: getGlassPage,
|
||||
exportURL: exportProductExcel
|
||||
},
|
||||
// dynamicProps: [],
|
||||
tableProps,
|
||||
timeTips:'',
|
||||
// dataForm: {
|
||||
// reportTime:undefined
|
||||
// },
|
||||
isSave:false,
|
||||
disabled: true,
|
||||
sumArr: [],
|
||||
weekValue1: null,//最多24周
|
||||
weekValue2: null,
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '工单名称',
|
||||
// placeholder: '请选择工单名称',
|
||||
// param: 'workOrderIdList',
|
||||
// selectOptions: [],
|
||||
// multiple: true,
|
||||
// labelField: 'name',
|
||||
// valueField: 'id',
|
||||
// defaultSelect: []
|
||||
// },
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '产品',
|
||||
// placeholder: '请选择产品',
|
||||
// param: 'productionId',
|
||||
// selectOptions: [],
|
||||
// },
|
||||
// {
|
||||
// type: 'input',
|
||||
// label: '检测内容',
|
||||
// placeholder: '请输入检测内容',
|
||||
// param: 'inspectionDetContent',
|
||||
// },
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'checkTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi(
|
||||
// 'base:quality-inspection-record:create'
|
||||
// )
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
],
|
||||
pickerOptionsWeek: {
|
||||
disabledDate(time) {
|
||||
let day = Date.now()
|
||||
let limitTime = moment(day).day(-1)
|
||||
return time.getTime() > new Date(limitTime).getTime()
|
||||
}
|
||||
},
|
||||
reportTime:undefined,
|
||||
dataForm: {
|
||||
// workOrderIdList:undefined,
|
||||
// productionId: undefined,
|
||||
// startTime: undefined,
|
||||
// endTime: undefined,
|
||||
reportTime: [],
|
||||
reportType:2
|
||||
// productionLineId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getProductLineList();
|
||||
},
|
||||
mounted() {
|
||||
// if (this.$route.params.startTime && this.$route.params.endTime) {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [
|
||||
// this.$route.params.startTime,
|
||||
// this.$route.params.endTime,
|
||||
// ];
|
||||
// this.queryParams.param = {};
|
||||
// this.$set(
|
||||
// this.queryParams.param,
|
||||
// 'startTime',
|
||||
// this.$route.params.startTime
|
||||
// );
|
||||
// this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
// console.log(time)
|
||||
// var y = time.getFullYear();
|
||||
// var m = time.getMonth() + 1;
|
||||
// var d = time.getDate();
|
||||
// var h = time.getHours();
|
||||
// var mm = time.getMinutes();
|
||||
// var s = time.getSeconds();
|
||||
return time
|
||||
},
|
||||
changeTime(val) {
|
||||
if (val) {
|
||||
// console.log(val)
|
||||
// console.log(val.setHours(7, 0, 0))
|
||||
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.dataForm.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.dataForm.reportTime);
|
||||
} else {
|
||||
this.dataForm.reportTime = []
|
||||
}
|
||||
},
|
||||
editDataList() {
|
||||
this.disabled = false
|
||||
this.isSave = true
|
||||
},
|
||||
async saveDataList() {
|
||||
let obj = {}
|
||||
this.list.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
this.list[index].lineId = ''
|
||||
this.list[index].remark = this.remark
|
||||
obj = ele
|
||||
this.list.splice(index,1)
|
||||
}
|
||||
})
|
||||
let updateArr = this.list
|
||||
// console.log(JSON.stringify(updateArr[1]))
|
||||
const result = await Promise.all([
|
||||
await updateSumProductionDataList(obj),
|
||||
await updateProductionDataList(updateArr),
|
||||
]);
|
||||
if (result[0].data == true && result[1].data == true) {
|
||||
// console.log(res)
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
} else {
|
||||
this.$modal.msgError('更新失败');
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '成品生产日报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
},
|
||||
async getDataList() {
|
||||
// if (this.weekValue1 && this.weekValue2) {
|
||||
// this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
// // this.queryParams.startTime = this.monthValue[0]
|
||||
// this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
// this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
|
||||
// } else {
|
||||
// }
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
method: 'get',
|
||||
params: this.dataForm
|
||||
})
|
||||
// console.log(this.queryParams);
|
||||
console.log(res)
|
||||
// let sum = undefined
|
||||
// res.data.list.forEach((ele, index) => {
|
||||
// if (ele.det === false) {
|
||||
// sum = res.data.list.splice(index, 1)
|
||||
// }
|
||||
// })
|
||||
res.data.list.forEach((ele,index) => {
|
||||
if (ele.det === false) {
|
||||
res.data.list[index].lineId = '合计'
|
||||
this.remark = res.data.list[index].remark
|
||||
}
|
||||
});
|
||||
this.list = res.data.list
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-01-24 15:59:13
|
||||
* @LastEditTime: 2024-03-04 16:51:38
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -32,26 +32,26 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="lineId" label="生产线">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.lineId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -59,21 +59,21 @@
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
@ -82,19 +82,19 @@
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
@ -103,21 +103,21 @@
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
@ -126,7 +126,9 @@
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
<el-input v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
@ -363,9 +365,25 @@ export default {
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
this.getCurrentWeekStartTimeAndEndTime()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
getCurrentWeekStartTimeAndEndTime() {
|
||||
const current = new Date();
|
||||
// current是本周的第几天
|
||||
let nowDayOfWeek = current.getDay();
|
||||
if (nowDayOfWeek === 0) nowDayOfWeek = 7;
|
||||
const dayNum = 1 * 24 * 60 * 60 * 1000;
|
||||
// 获取本周星期一的时间,星期一作为一周的第一天
|
||||
const firstDate = new Date(current.valueOf() - (nowDayOfWeek - 1) * dayNum);
|
||||
// 获取本周星期天的时间,星期天作为一周的最后一天
|
||||
const lastDate = new Date(new Date(firstDate).valueOf() + 6 * dayNum);
|
||||
// return {
|
||||
this.weekValue1 = new Date(firstDate)
|
||||
this.weekValue2 = new Date(lastDate)
|
||||
// };
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
@ -380,6 +398,7 @@ export default {
|
||||
}).catch(() => { });
|
||||
},
|
||||
startWeek() {
|
||||
// console.log(this.weekValue1);
|
||||
if (this.weekValue1 && this.weekValue2) {
|
||||
let a = new Date(this.weekValue1).getTime()
|
||||
let b = new Date(this.weekValue2).getTime()
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-01-24 15:59:21
|
||||
* @LastEditTime: 2024-03-05 09:47:42
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -9,11 +9,9 @@
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker style='width:170px;' v-model="yearValue1" type="year" :picker-options="pickerOptions"
|
||||
value-format="timestamp" placeholder="选择年" @change="startYear" size="small" :clearable="false">
|
||||
</el-date-picker>-
|
||||
<el-date-picker style='width:170px;' v-model="yearValue2" type="year" :picker-options="pickerOptions"
|
||||
value-format="timestamp" placeholder="选择年" @change="endYear" size="small" :clearable="false">
|
||||
<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 type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -34,26 +32,26 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="lineId" label="生产线">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.lineId" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.lineId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -61,21 +59,21 @@
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
@ -84,19 +82,19 @@
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
@ -105,21 +103,21 @@
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
@ -128,7 +126,9 @@
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
<el-input v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
@ -158,7 +158,7 @@ import {
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
@ -265,6 +265,9 @@ export default {
|
||||
yearValue2: null,
|
||||
// dynamicProps: [],
|
||||
tableProps,
|
||||
reportTime: [],
|
||||
startTimeStamp: '',
|
||||
endTimeStamp: '',
|
||||
dataForm: {
|
||||
// workOrderIdList:undefined,
|
||||
// productionId: undefined,
|
||||
@ -345,6 +348,8 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCurrentYearFirst()
|
||||
|
||||
// this.getProductLineList();
|
||||
},
|
||||
mounted() {
|
||||
@ -366,6 +371,16 @@ export default {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
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).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
@ -379,34 +394,34 @@ export default {
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
},
|
||||
startYear() {
|
||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
||||
this.yearValue1 = null
|
||||
return false
|
||||
}
|
||||
if (this.yearValue1 && this.yearValue2) {
|
||||
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
||||
this.yearValue1 = null
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
endYear() {
|
||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
||||
this.yearValue2 = null
|
||||
return false
|
||||
}
|
||||
if (this.yearValue1 && this.yearValue2) {
|
||||
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
||||
this.yearValue2 = null
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
// startYear() {
|
||||
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
// this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
||||
// this.yearValue1 = null
|
||||
// return false
|
||||
// }
|
||||
// if (this.yearValue1 && this.yearValue2) {
|
||||
// if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||
// this.$modal.msgError('最大时间范围为10年,请重新选择')
|
||||
// this.yearValue1 = null
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// endYear() {
|
||||
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
// this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
||||
// this.yearValue2 = null
|
||||
// return false
|
||||
// }
|
||||
// if (this.yearValue1 && this.yearValue2) {
|
||||
// if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||
// this.$modal.msgError('最大时间范围为10年,请重新选择')
|
||||
// this.yearValue2 = null
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
editDataList() {
|
||||
this.disabled = false
|
||||
this.isSave = true
|
||||
@ -442,15 +457,37 @@ export default {
|
||||
let value = newData
|
||||
return value
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val);
|
||||
if (val) {
|
||||
// let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
||||
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.dataForm.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)
|
||||
},
|
||||
async getDataList() {
|
||||
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)
|
||||
this.timeTips = this.transformYear(this.yearValue1) + " - " + this.transformYear(this.yearValue1)
|
||||
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
|
||||
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
|
||||
// this.timeTips = this.transformYear(this.yearValue1) + " - " + this.transformYear(this.yearValue1)
|
||||
}
|
||||
}
|
||||
this.loading = true;
|
||||
|
Loading…
Reference in New Issue
Block a user