From 9ea2f2dbe31e0a5120132c56816606a3bb01f291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Tue, 9 Jul 2024 11:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dayReportComponents/ExportDayReport.vue | 2 +- .../dayReportExportChart/beProcessed.vue | 9 +-- .../dayReportExportChart/productYield.vue | 5 +- src/views/produce/workOrder/index.vue | 58 ++++++++++--------- src/views/report/comprehensiveData.vue | 4 +- src/views/report/produceConversion.vue | 2 +- src/views/report/productionSituationMW.vue | 2 +- .../report/productionSituationTablets.vue | 2 +- src/views/report/productionYield.vue | 2 +- 9 files changed, 42 insertions(+), 44 deletions(-) diff --git a/src/views/produce/workOrder/dayReportComponents/ExportDayReport.vue b/src/views/produce/workOrder/dayReportComponents/ExportDayReport.vue index 06bedc7..10da7f9 100644 --- a/src/views/produce/workOrder/dayReportComponents/ExportDayReport.vue +++ b/src/views/produce/workOrder/dayReportComponents/ExportDayReport.vue @@ -57,7 +57,7 @@ export default { }, beProcessObj: { type: Object, - default: () => { } + default: () => {} }, }, data() { diff --git a/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/beProcessed.vue b/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/beProcessed.vue index c52a5f2..029b95e 100644 --- a/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/beProcessed.vue +++ b/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/beProcessed.vue @@ -1,10 +1,3 @@ - @@ -18,7 +11,7 @@ export default { props: { beProcessObj: { type: Object, - default: () => {} + default: () => { } } }, data() { diff --git a/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/productYield.vue b/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/productYield.vue index d8df227..1904367 100644 --- a/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/productYield.vue +++ b/src/views/produce/workOrder/dayReportComponents/dayReportExportChart/productYield.vue @@ -1,7 +1,7 @@ @@ -66,7 +66,8 @@ export default { }, legend: { bottom: 0, - left: 'center' + left: 'center', + itemGap:40, }, series: [ { diff --git a/src/views/produce/workOrder/index.vue b/src/views/produce/workOrder/index.vue index 8d137c3..75365ec 100644 --- a/src/views/produce/workOrder/index.vue +++ b/src/views/produce/workOrder/index.vue @@ -1,7 +1,7 @@ @@ -338,7 +338,7 @@ export default { } }) }, - async otherMethods(val) { + otherMethods(val) { console.log(val) if (val.type === 'detail') { this.detailOrUpdateVisible = true; @@ -347,33 +347,37 @@ export default { this.$refs.detailOrUpdate.init(val.data.id); }); } else { - const res = await getWorkOrderDetail(val.data.id) - if (res.code === 0) { - // this.loading = false - ;const data = res.data.prodWorkOrderDO - const barList = [data.targetProduction, data.plannedInvestment, data.actualInvestment, data.actualProduction, data.wasteNum, data.reworkNum] - const seriesList = [] - const dateList = [] - res.data.his.forEach(element => { - seriesList.push(element.actualProduction) - dateList.push(element.recordTime[0] + '-' + element.recordTime[1] + '-' + element.recordTime[2]) + getWorkOrderDetail(val.data.id).then((res) => { + if (res.code === 0) { + // this.loading = false + + const xAxisList = Object.keys(res.data.inProcessDis) + const yAxisList = Object.values(res.data.inProcessDis) + this.beProcessObj.xAxisList = xAxisList + this.beProcessObj.yAxisList = yAxisList + // console.log(this.beProcessObj) + ; const data = res.data.prodWorkOrderDO + const barList = [data.targetProduction, data.plannedInvestment, data.actualInvestment, data.actualProduction, data.wasteNum, data.reworkNum] + const seriesList = [] + const dateList = [] + res.data.his.forEach(element => { + seriesList.push(element.actualProduction) + dateList.push(element.recordTime[0] + '-' + element.recordTime[1] + '-' + element.recordTime[2]) + }) + this.hisObj.seriesList = seriesList + this.hisObj.dateList = dateList + this.produceData = barList + this.pieList = [ + { value: data.actualProduction ? data.actualProduction : 0, name: '实际产出' }, + { value: data.wasteNum ? data.wasteNum : 0, name: '废品数量' }, + { value: data.reworkNum ? data.reworkNum : 0, name: '待再加工数量' } + ] + } + this.$nextTick(() => { + this.exportPDF() }) - this.hisObj.seriesList = seriesList - this.hisObj.dateList = dateList - const xAxisList = Object.keys(res.data.inProcessDis) - const yAxisList = Object.values(res.data.inProcessDis) - this.beProcessObj.xAxisList = xAxisList - this.beProcessObj.yAxisList = yAxisList - this.produceData = barList - this.pieList = [ - { value: data.actualProduction ? data.actualProduction : 0, name: '实际产出' }, - { value: data.wasteNum ? data.wasteNum : 0, name: '废品数量' }, - { value: data.reworkNum ? data.reworkNum : 0, name: '待再加工数量' } - ] - } - this.$nextTick(() => { - this.exportPDF() }) + } }, async getDataList() { diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index 26f764d..45a096f 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -344,7 +344,7 @@ export default { }, async getDataList() { console.log(this.listQuery.type); - if (this.listQuery.type == null) { + if (this.listQuery.type == null || this.listQuery.type == '') { return this.$message('请选择时间维度') } if (!this.listQuery.startDate && !this.listQuery.endDate) { diff --git a/src/views/report/produceConversion.vue b/src/views/report/produceConversion.vue index f1608ea..7837c1f 100644 --- a/src/views/report/produceConversion.vue +++ b/src/views/report/produceConversion.vue @@ -546,7 +546,7 @@ export default { this.chartMsgYearTarget.series[0].data = [] this.chartMsgYearTarget.series[1].data = [] this.title = '' - if (this.listQuery.date == null) { + if (this.listQuery.date == null || this.listQuery.date == '') { return this.$message('请选择时间维度') } if (!this.listQuery.beginTime && !this.listQuery.endTime) { diff --git a/src/views/report/productionSituationMW.vue b/src/views/report/productionSituationMW.vue index 7c43c6c..ab75dd8 100644 --- a/src/views/report/productionSituationMW.vue +++ b/src/views/report/productionSituationMW.vue @@ -517,7 +517,7 @@ export default { this.chartMsgYearTarget.series[0].data = [] this.chartMsgYearTarget.series[1].data = [] console.log(this.listQuery); - if (this.listQuery.type == null) { + if (this.listQuery.type == null || this.listQuery.type == '') { return this.$message('请选择时间维度') } if (!this.listQuery.startDate && !this.listQuery.endDate) { diff --git a/src/views/report/productionSituationTablets.vue b/src/views/report/productionSituationTablets.vue index 700fc06..82322fb 100644 --- a/src/views/report/productionSituationTablets.vue +++ b/src/views/report/productionSituationTablets.vue @@ -649,7 +649,7 @@ export default { this.chartMsgYearTarget.series[3].data = [] } // console.log(this.listQuery); - if (this.listQuery.type == null) { + if (this.listQuery.type == null || this.listQuery.type == '') { return this.$message('请选择时间维度') } if (!this.listQuery.startDate && !this.listQuery.endDate) { diff --git a/src/views/report/productionYield.vue b/src/views/report/productionYield.vue index 874973c..3c0b353 100644 --- a/src/views/report/productionYield.vue +++ b/src/views/report/productionYield.vue @@ -567,7 +567,7 @@ export default { this.chartMsgYearTarget.xData = [] this.chartMsgYearTarget.series[0].data = [] this.chartMsgYearTarget.series[1].data = [] - if (this.listQuery.type == null) { + if (this.listQuery.type == null || this.listQuery.type == '') { return this.$message('请选择时间维度') } if (!this.listQuery.startDate && !this.listQuery.endDate) {