From 2f98b42bd298d517b936724a87d2f02f5f35995c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Tue, 23 Apr 2024 13:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 6 +- src/api/report/qcReport.js | 18 +- .../Environmental/productionDayR/index.vue | 6 +- .../report/qcReport/cutDayReport/index.vue | 252 ++++++++++--- .../report/qcReport/fullInspection/index.vue | 342 ++++++++++++++++-- src/views/report/qcReport/lineReport.vue | 28 +- src/views/report/qcReport/optimizeCutData.vue | 28 +- 7 files changed, 579 insertions(+), 101 deletions(-) diff --git a/.env.dev b/.env.dev index 0a1d39c9..57f02cb8 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-12 14:30:48 - # @LastEditTime: 2024-04-22 16:16:52 + # @LastEditTime: 2024-04-23 13:34:27 # @LastEditors: zhp # @Description: ### @@ -12,8 +12,8 @@ ENV = 'development' VUE_APP_TITLE = MES系统 # 芋道管理系统/开发环境 -# VUE_APP_BASE_API = 'http://192.168.0.33:48082' -VUE_APP_BASE_API = 'http://192.168.1.104:48082' +VUE_APP_BASE_API = 'http://192.168.0.33:48082' +# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # 积木报表指向地址 VUE_APP_JIMU_API = 'http://192.168.0.33:48082' diff --git a/src/api/report/qcReport.js b/src/api/report/qcReport.js index 8d0a0e26..c4e252ec 100644 --- a/src/api/report/qcReport.js +++ b/src/api/report/qcReport.js @@ -1,7 +1,7 @@ /* * @Author: zhp * @Date: 2024-04-18 09:27:54 - * @LastEditTime: 2024-04-22 16:21:26 + * @LastEditTime: 2024-04-23 13:37:12 * @LastEditors: zhp * @Description: */ @@ -62,3 +62,19 @@ export function updateAutoDailyData(data) { data: data }) } + +export function getCWSectionList(query) { + return request({ + url: 'base/core-production-line/listAll', + method: 'get', + params: query + }) +} + +export function getCuttingReportDataList(data) { + return request({ + url: 'extend/customized-reports/cuttingReport', + method: 'post', + data: data + }) +} diff --git a/src/views/report/Environmental/productionDayR/index.vue b/src/views/report/Environmental/productionDayR/index.vue index 1e5821ca..289c08c1 100644 --- a/src/views/report/Environmental/productionDayR/index.vue +++ b/src/views/report/Environmental/productionDayR/index.vue @@ -1,7 +1,7 @@ @@ -16,9 +16,9 @@ - 查询 - 导出 diff --git a/src/views/report/qcReport/cutDayReport/index.vue b/src/views/report/qcReport/cutDayReport/index.vue index 24715252..6edd5726 100644 --- a/src/views/report/qcReport/cutDayReport/index.vue +++ b/src/views/report/qcReport/cutDayReport/index.vue @@ -1,10 +1,22 @@ + - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + 查询 + 导出 + + - - - + + + - - + - + + + + + + 合计 + + + {{ sum }} + + @@ -57,7 +89,8 @@ // import basicPage from '../../../core/mixins/basic-page'; // import { parseTime } from '../../../core/mixins/code-filter'; import { - getQualityRecordReport + getQualityRecordReport, + getCWSectionList } from '@/api/report/qcReport'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import FileSaver from 'file-saver' @@ -114,7 +147,68 @@ export default { // deleteURL: deleteQualityHotMaterial, // exportURL: exportFactoryExcel, }, - codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'], + listQuery: { + startTime: null, + productionLineId:null, + }, + sum:null, + radio:'晚班查询', + lineList:[], + codeList: [ + { + label: '19:00', + prop: 'num0' + + }, + { + label: '20:00', + prop: 'num1' + }, + { + label: '21:00', + prop: 'num2' + }, + { + label: '22:00', + prop: 'num3' + }, + { + label: '23:00', + prop: 'num4' + }, + { + label: '00:00', + prop: 'num5' + }, + { + label: '01:00', + prop: 'num6' + }, + { + label: '02:00', + prop: 'num7' + }, + { + label: '03:00', + prop: 'num8' + }, + { + label: '04:00', + prop: 'num9' + }, + { + label: '05:00', + prop: 'num10' + }, + { + label: '06:00', + prop: 'num11' + }, + { + label: '合计', + prop: 'sum' + } + ], tableData: [], formConfig: [ { @@ -156,35 +250,186 @@ export default { // this.listQuery.startTime = this.formConfig[0].defaultSelect[0] // this.listQuery.endTime = this.formConfig[0].defaultSelect[1] // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 + this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime() this.getDataList() + this.getDict() // this.getSpanArr(this.tableData) // this.getDict(); }, methods: { - objectSpanMethod({ row, column, rowIndex, columnIndex }) { - let spanOneArr = [], concatOne = 0; - this.tableData.map((item, index) => { - if (index === 0) { - spanOneArr.push(1); - } else { - //第一列需合并相同内容的判断条件 - if (item.className === this.tableData[index - 1].className) { - spanOneArr[concatOne] += 1; - spanOneArr.push(0); - } else { - spanOneArr.push(1); - concatOne = index; - }; - } - }); + async getDict() { + const res = await getCWSectionList() + console.log(res) + this.lineList = res.data + }, + // objectSpanMethod({ row, column, rowIndex, columnIndex }) { + // let spanOneArr = [], concatOne = 0; + // this.tableData.map((item, index) => { + // if (index === 0) { + // spanOneArr.push(1); + // } else { + // //第一列需合并相同内容的判断条件 + // if (item.className === this.tableData[index - 1].className) { + // spanOneArr[concatOne] += 1; + // spanOneArr.push(0); + // } else { + // spanOneArr.push(1); + // concatOne = index; + // }; + // } + // }); - if (columnIndex === 0) { - const _row = spanOneArr[rowIndex]; - const _col = _row > 0 ? 1 : 0; - return { - rowspan: _row, - colspan: _col - } + // if (columnIndex === 0) { + // const _row = spanOneArr[rowIndex]; + // const _col = _row > 0 ? 1 : 0; + // return { + // rowspan: _row, + // colspan: _col + // } + // } + // }, + formatDateTime(time) { + var date = new Date(time); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + + return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; + }, + handleGetClass(e) { + + this.listQuery.startTime = new Date(new Date().setHours(0, 7, 0, 0)).getTime() + // console.log(startTime1) + this.codeList = [] + if (e === '早班查询') { + let arr = [ + { + label: '07:00', + prop:'num0' + }, + { + label: '08:00', + prop: 'num1' + }, + { + label: '09:00', + prop: 'num2' + }, + { + label: '10:00', + prop: 'num3' + }, + { + label: '11:00', + prop: 'num4' + }, + { + label: '12:00', + prop: 'num5' + }, + { + label: '13:00', + prop: 'num6' + }, + { + label: '14:00', + prop: 'num7' + }, + { + label: '15:00', + prop: 'num8' + }, + { + label: '16:00', + prop: 'num9' + }, + { + label: '17:00', + prop: 'num10' + }, + { + label: '18:00', + prop: 'num11' + }, + { + label: '合计', + prop: 'sum' + } + ] + arr.forEach((ele,index) => [ + this.codeList.push(ele) + ]) + this.getDataList() + } else { + // this.codeList = [] + this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime() + let arr = [ + { + label: '19:00', + prop: 'num0' + + }, + { + label: '20:00', + prop: 'num1' + }, + { + label: '21:00', + prop: 'num2' + }, + { + label: '22:00', + prop: 'num3' + }, + { + label: '23:00', + prop: 'num4' + }, + { + label: '00:00', + prop: 'num5' + }, + { + label: '01:00', + prop: 'num6' + }, + { + label: '02:00', + prop: 'num7' + }, + { + label: '03:00', + prop: 'num8' + }, + { + label: '04:00', + prop: 'num9' + }, + { + label: '05:00', + prop: 'num10' + }, + { + label: '06:00', + prop: 'num11' + }, + { + label: '合计', + prop: 'sum' + } + ] + arr.forEach((ele, index) => [ + this.codeList.push(ele) + ]) + this.getDataList() } }, handleExport() { @@ -236,10 +481,35 @@ export default { // this.listQuery.startTime = '1713197388000'; // this.listQuery.endTime = '1713254961000'; this.urlOptions.getDataListURL({ - productionLineId: '1696716506443354114', - startTime: '1705618800000' + // productionLineId: '1696716506443354114', + // startTime: '1705618800000' + productionLineId: this.listQuery.productionLineId, + startTime:this.listQuery.startTime },).then(res => { - console.log(res.data); + let count = 0 + let arr = [] + console.log(res.data) + this.sum = res.data.allSum + for (let i in res.data.qualityInspectionRecordReportLineVOMap) { + count ++, + console.log(res.data.qualityInspectionRecordReportLineVOMap[i]) + // arr.push({ + + // }) + // console.log(arr) + let obj = { + name: res.data.qualityInspectionRecordReportLineVOMap[i].content, + sum: res.data.qualityInspectionRecordReportLineVOMap[i].sum, + } + res.data.qualityInspectionRecordReportLineVOMap[i].nums.forEach((ele, index) => { + obj['num' +index] = ele + // console.log(arr[count]) + // arr[count]['num'+index] = ele + }) + arr.push(obj) + } + console.log(arr); + this.tableData = arr // console.log(res) // console.log(res.data) // let arr = [ diff --git a/src/views/report/qcReport/lineReport.vue b/src/views/report/qcReport/lineReport.vue index 88125958..8ac78d80 100644 --- a/src/views/report/qcReport/lineReport.vue +++ b/src/views/report/qcReport/lineReport.vue @@ -1,7 +1,7 @@ @@ -35,7 +35,8 @@ // import basicPage from '../../../core/mixins/basic-page'; // import { parseTime } from '../../../core/mixins/code-filter'; import { - getOriginalData + getOriginalData, + getCWSectionList } from '@/api/report/qcReport'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import FileSaver from 'file-saver' @@ -98,7 +99,8 @@ export default { pos: 0, listQuery: { startTime: undefined, - endTime:undefined + endTime: undefined, + lineId:null, }, formConfig: [ // { @@ -129,6 +131,15 @@ export default { defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], width: 250 }, + { + type: 'select', + label: '产线', + selectOptions: [], + labelField: 'name', + valueField: 'id', + param: 'lineId', + filterable: true + }, { type:'button', btnName: '查询', @@ -159,10 +170,16 @@ export default { this.listQuery.endTime = this.formConfig[0].defaultSelect[1] // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 this.getDataList() + this.getDict() // this.getSpanArr(this.tableData) // this.getDict(); }, methods: { + async getDict() { + const res = await getCWSectionList() + console.log(res) + this.formConfig[1].selectOptions = res.data + }, // getSummaries(param) { // console.log(columns) @@ -264,8 +281,8 @@ export default { // 获取数据列表 getDataList() { this.dataListLoading = true; - this.listQuery.startTime = '1711095616000'; - this.listQuery.endTime = '1711183743000'; + // this.listQuery.startTime = '1711095616000'; + // this.listQuery.endTime = '1711183743000'; this.urlOptions.getDataListURL(this.listQuery).then(response => { // this.getSpanArr(this.tableData) // response.data.forEach((ele) => { @@ -346,6 +363,7 @@ export default { // this.listQuery.endTime = '1706230804000'; this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; + this.listQuery.lineId = val.lineId ? val.lineId : undefined this.getDataList(); break; // case 'reset': diff --git a/src/views/report/qcReport/optimizeCutData.vue b/src/views/report/qcReport/optimizeCutData.vue index b5a28c15..eca06880 100644 --- a/src/views/report/qcReport/optimizeCutData.vue +++ b/src/views/report/qcReport/optimizeCutData.vue @@ -1,7 +1,7 @@ @@ -35,7 +35,8 @@ // import basicPage from '../../../core/mixins/basic-page'; // import { parseTime } from '../../../core/mixins/code-filter'; import { - getCuttingtData + getCuttingtData, + getCWSectionList } from '@/api/report/qcReport'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import FileSaver from 'file-saver' @@ -97,7 +98,8 @@ export default { pos: 0, listQuery: { startTime: undefined, - endTime:undefined + endTime: undefined, + lineId:null }, formConfig: [ // { @@ -128,6 +130,15 @@ export default { defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], width: 250 }, + { + type: 'select', + label: '产线', + selectOptions: [], + labelField: 'name', + valueField: 'id', + param: 'lineId', + filterable: true + }, { type:'button', btnName: '查询', @@ -158,10 +169,16 @@ export default { this.listQuery.endTime = this.formConfig[0].defaultSelect[1] // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 this.getDataList() + this.getDict() // this.getSpanArr(this.tableData) // this.getDict(); }, methods: { + async getDict() { + const res = await getCWSectionList() + console.log(res) + this.formConfig[1].selectOptions = res.data + }, getSummaries(param) { console.log(columns) @@ -281,8 +298,8 @@ export default { // 获取数据列表 getDataList() { this.dataListLoading = true; - this.listQuery.startTime = '1706144404000'; - this.listQuery.endTime = '1706230804000'; + // this.listQuery.startTime = '1706144404000'; + // this.listQuery.endTime = '1706230804000'; this.urlOptions.getDataListURL(this.listQuery).then(response => { // this.getSpanArr(this.tableData) // response.data.forEach((ele) => { @@ -368,6 +385,7 @@ export default { // this.listQuery.endTime = '1706230804000'; this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; + this.listQuery.lineId = val.lineId ? val.lineId : undefined this.getDataList(); break; // case 'reset':