From c8bc54e04bc93ff4ca945c854e5fac55429f83d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Wed, 19 Jun 2024 16:25:50 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/report/index.js | 19 +- .../report/components/produceLineBar.vue | 220 ++++++++++++ src/views/report/comprehensiveData.vue | 19 +- src/views/report/produceConversion.vue | 257 ++++++++------ src/views/report/productionSituationMW.vue | 175 ++++----- .../report/productionSituationTablets.vue | 186 ++++++---- src/views/report/productionYield.vue | 336 ++++++++++++------ 7 files changed, 812 insertions(+), 400 deletions(-) create mode 100644 src/views/report/components/produceLineBar.vue diff --git a/src/api/report/index.js b/src/api/report/index.js index 8571ad5..9c6ea60 100644 --- a/src/api/report/index.js +++ b/src/api/report/index.js @@ -1,7 +1,7 @@ /* * @Author: zhp * @Date: 2024-06-17 09:41:03 - * @LastEditTime: 2024-06-18 13:47:36 + * @LastEditTime: 2024-06-19 13:30:14 * @LastEditors: zhp * @Description: */ @@ -21,3 +21,20 @@ export function getProduceTransData(data) { data: data }) } + + +export function getProduceSituationData(data) { + return request({ + url: 'ip/production/situation/get/production/situation', + method: 'post', + data: data + }) +} + +export function getProductionSituationMWData(data) { + return request({ + url: 'ip/production/situation/power/get/production/situation', + method: 'post', + data: data + }) +} diff --git a/src/views/report/components/produceLineBar.vue b/src/views/report/components/produceLineBar.vue new file mode 100644 index 0000000..19a58f0 --- /dev/null +++ b/src/views/report/components/produceLineBar.vue @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + {{ item.name }} + + + + + + + diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index 73a9f68..7d2b818 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -21,7 +21,7 @@ + start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> @@ -34,9 +34,8 @@ - + @@ -100,9 +99,11 @@ export default { start: undefined, end: undefined, listQuery: { + pageNo: 1, + pageSize: 999, // size: 10, // current: 1, - factory: null, + factory: undefined, // total: 0, type: 2, startDate: undefined, @@ -236,7 +237,7 @@ export default { mounted() { // this.getOverView() const currentMonth = new Date() - this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')] + this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')] this.changeTime() this.getDataList() }, @@ -294,8 +295,8 @@ export default { }, onValueChange(picker, k) { // 选中近k周后触发的操作 if (this.start && this.end) { - this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') - this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') + this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') + this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000); if (numDays > 168) { console.log(numDays) diff --git a/src/views/report/produceConversion.vue b/src/views/report/produceConversion.vue index f8e9637..1e76b70 100644 --- a/src/views/report/produceConversion.vue +++ b/src/views/report/produceConversion.vue @@ -7,17 +7,17 @@ - + - + + start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> - + @@ -29,13 +29,12 @@ {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周 --> - - + + - + @@ -79,65 +78,28 @@ - diff --git a/src/views/report/components/produceLineBarYearTarget.vue b/src/views/report/components/produceLineBarYearTarget.vue new file mode 100644 index 0000000..8fb9c80 --- /dev/null +++ b/src/views/report/components/produceLineBarYearTarget.vue @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + {{ item.name }} + + + + + + + diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index 7d2b818..416d87c 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -76,7 +76,7 @@ + diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index e3529a6..e46da5e 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -57,8 +57,8 @@ 导出 - + @@ -86,7 +86,7 @@ export default { return { factoryList, factoryArray, - + currentMenu:'邯郸', listQuery: { pageNo: 1, pageSize: 999, @@ -147,7 +147,7 @@ export default { otherProps:[], tableData: [], xAxis: [], - currentMenu:null, + // currentMenu:null, lineData: {}, data: {} // proLineList: [], @@ -200,6 +200,35 @@ export default { this.getDataList() }, methods: { + objectSpanMethod({ row, column, rowIndex, columnIndex }) { + let spanOneArr = [], concatOne = 0; + // let spanTwoArr = [], concatTwo = 0; + + this.tableData.map((item, index) => { + // console.log(inde); + if (index === 0) { + spanOneArr.push(1); + } else { + //第一列需合并相同内容的判断条件 + if (item.type === this.tableData[index - 1].type) { + spanOneArr[concatOne] += 1; + spanOneArr.push(0); + } else { + spanOneArr.push(1); + concatOne = index; + }; + } + }); + + if (columnIndex === 1) { + const _row = spanOneArr[rowIndex]; + const _col = _row > 0 ? 1 : 0; + return { + rowspan: _row, + colspan: _col + } + } + }, getYear(e) { if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) { this.$message({ @@ -288,7 +317,7 @@ export default { this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2) this.listQuery.factory = arr const res = await getComprehensiveDataPage(this.listQuery) - this.tableData = res.data.list + // this.tableData = res.data.list let dataArr = [{ type: '芯片', item: 'FTO投入', @@ -412,7 +441,7 @@ export default { // this.chartMsg.xData.push(ele.titleValue) this.otherProps.push({ label: ele.titleValue, - props: 'value' + i + prop: 'value' + i }) }) console.log(this.otherProps) @@ -456,6 +485,7 @@ export default { // props: 'value' + index + 1, // }) }) + console.log(dataArr); if (res.data.length === 0) { this.tableData = [] } else { diff --git a/src/views/report/produceConversion.vue b/src/views/report/produceConversion.vue index 874d994..1f45f91 100644 --- a/src/views/report/produceConversion.vue +++ b/src/views/report/produceConversion.vue @@ -13,54 +13,41 @@ - + - + 至 - + - - - + + - - + ~ - - - 查询 - - 导出 - @@ -77,7 +64,7 @@ {{ title }} - @@ -97,8 +84,8 @@ :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" /> --> - + - + - + - + @@ -83,7 +83,7 @@ export default { dataZoom: [//滚动条 { // 设置滚动条的隐藏与显示 - show: true, + show: false, // 设置滚动条类型 type: "slider", // 设置背景颜色 diff --git a/src/views/report/components/produceLineBarTarget.vue b/src/views/report/components/produceLineBarTarget.vue index 119ed45..bd32a6b 100644 --- a/src/views/report/components/produceLineBarTarget.vue +++ b/src/views/report/components/produceLineBarTarget.vue @@ -1,14 +1,7 @@ - @@ -90,7 +83,7 @@ export default { dataZoom: [//滚动条 { // 设置滚动条的隐藏与显示 - show: true, + show: false, // 设置滚动条类型 type: "slider", // 设置背景颜色 diff --git a/src/views/report/components/produceLineBarYearTarget.vue b/src/views/report/components/produceLineBarYearTarget.vue index bf0f01d..a4f9005 100644 --- a/src/views/report/components/produceLineBarYearTarget.vue +++ b/src/views/report/components/produceLineBarYearTarget.vue @@ -1,7 +1,7 @@ @@ -83,7 +83,7 @@ export default { dataZoom: [//滚动条 { // 设置滚动条的隐藏与显示 - show: true, + show: false, // 设置滚动条类型 type: "slider", // 设置背景颜色 diff --git a/src/views/report/components/produceLineYieldBarTarget.vue b/src/views/report/components/produceLineYieldBarTarget.vue index 411bf8c..e40582c 100644 --- a/src/views/report/components/produceLineYieldBarTarget.vue +++ b/src/views/report/components/produceLineYieldBarTarget.vue @@ -1,7 +1,7 @@ @@ -101,7 +101,7 @@ export default { dataZoom: [//滚动条 { // 设置滚动条的隐藏与显示 - show: true, + show: false, // 设置滚动条类型 type: "slider", // 设置背景颜色 diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index e46da5e..2d9ab0d 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -58,7 +58,7 @@ + :limit="listQuery.pageSize" :table-data="tableData" :max-height="tableH"> @@ -101,6 +101,7 @@ export default { end: undefined, reportTime: [] }, + tableH: this.tableHeight(269), timeList: [ { value: 0, @@ -191,6 +192,7 @@ export default { // this.changeTime() // }, mounted() { + this.tableH = this.tableHeight(269); // this.getOverView() const today = new Date() const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) @@ -489,7 +491,7 @@ export default { if (res.data.length === 0) { this.tableData = [] } else { - if (this.currentMenu !== '瑞昌') { + if (this.currentMenu != '瑞昌') { this.tableData = dataArr } else { this.tableData = dataArr.filter(function (item) { @@ -497,13 +499,6 @@ export default { }); } } - this.listQuery.total = res.data.total - if (this.listQuery.total > 0) { - this.tableData.forEach(item => { - item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--' - item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--' - }) - } }, buttonClick(val) { this.listQuery.factorys = val.factory?.length > 0 ? val.factory : undefined diff --git a/src/views/report/produceConversion.vue b/src/views/report/produceConversion.vue index bcb508e..6787cd9 100644 --- a/src/views/report/produceConversion.vue +++ b/src/views/report/produceConversion.vue @@ -195,26 +195,7 @@ export default { { name: "", // yAxisIndex: 0, - data: [ - { - value: 1, - itemStyle: { - color: '#8EF0AB' - } - }, - { - value: 2, - itemStyle: { - color: '#288AFF' - } - }, - { - value: 0, - yAxisIndex: 1, - itemStyle: { - color: '#64BDFF' - } - }], + data: [], type: "bar", barWidth: 20, label: { @@ -229,13 +210,7 @@ export default { { name: '', type: 'bar', - data: [0, 0, 0, - { - value: 5, - itemStyle: { - color: '#68C483' - } - }], + data: [], type: "bar", barWidth: 20, label: { @@ -370,7 +345,7 @@ export default { watch: { // 监听左侧菜单栏是否展开 isOpen(val) { - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "produceConversion") { this.chartNum++; } }, @@ -385,7 +360,7 @@ export default { }, activated() { // 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新 - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "produceConversion") { this.chartNum++; } }, @@ -513,6 +488,12 @@ export default { async getDataList() { this.otherProps = [] this.chartMsg.xData = [] + this.chartMsg.series[0].data = [] + this.chartMsg.series[1].data = [] + this.chartMsg.series[2].data = [] + this.chartMsgYearTarget.series[0].data = [] + this.chartMsgYearTarget.series[1].data = [] + console.log(this.listQuery); if (this.listQuery.type == 3) { this.listQuery.beginTime = this.listQuery.reportTime[0] @@ -676,7 +657,7 @@ export default { _setTableHeight() { this.tableH = this.tableHeight(137) / 2 - 70; this.chartHeight = this.tableHeight(137) / 2 - 111; - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "produceConversion") { this.chartNum++; } }, diff --git a/src/views/report/productionSituationMW.vue b/src/views/report/productionSituationMW.vue index ad28d95..a35f402 100644 --- a/src/views/report/productionSituationMW.vue +++ b/src/views/report/productionSituationMW.vue @@ -95,6 +95,9 @@ --> + + 生产情况对比 + @@ -291,7 +294,7 @@ export default { }, computed: { dataArr() { - if (this.currentMenu != '瑞昌') { + // if (this.currentMenu != '瑞昌') { return [{ factory: null, item: '芯片总功率', @@ -302,7 +305,7 @@ export default { item: ' 标准组件总功率', unit: 'MW' }] - } + // } }, tableProps() { return [ @@ -484,6 +487,11 @@ export default { this.chartMsg.xData = [] this.chartMsgTarget.xData = [] this.chartMsgYearTarget.xData = [] + this.chartMsg.series[0].data = [] + this.chartMsg.series[1].data = [] + this.chartMsgTarget.series = [] + this.chartMsgYearTarget.series[0].data = [] + this.chartMsgYearTarget.series[1].data = [] console.log(this.listQuery); let arr = [] this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) diff --git a/src/views/report/productionSituationTablets.vue b/src/views/report/productionSituationTablets.vue index 27bf95b..c33d94c 100644 --- a/src/views/report/productionSituationTablets.vue +++ b/src/views/report/productionSituationTablets.vue @@ -95,6 +95,9 @@ --> + + 生产情况对比 + @@ -257,9 +260,7 @@ export default { }, axisLabel: {}, }, - series: [ - - ], + series: [], }, chartMsg: { color: ["#8EF0AB", "#288AFF", "#64BDFF", '#7164FF'], @@ -425,7 +426,7 @@ export default { watch: { // 监听左侧菜单栏是否展开 isOpen(val) { - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "productionSituationTablets") { this.chartNum++; } }, @@ -440,7 +441,7 @@ export default { }, activated() { // 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新 - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "productionSituationTablets") { this.chartNum++; } }, @@ -570,6 +571,19 @@ export default { this.chartMsg.xData = [] this.chartMsgTarget.xData = [] this.chartMsgYearTarget.xData = [] + this.chartMsg.series[0].data = [] + this.chartMsg.series[1].data = [] + this.chartMsg.series[2].data = [] + if (this.chartMsg.series[3]) { + this.chartMsg.series[3].data = [] + } + this.chartMsgTarget.series = [] + this.chartMsgYearTarget.series[0].data = [] + this.chartMsgYearTarget.series[1].data = [] + this.chartMsgYearTarget.series[2].data = [] + if (this.chartMsgYearTarget.series[3]) { + this.chartMsgYearTarget.series[3].data = [] + } console.log(this.listQuery); let arr = [] this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) @@ -1187,7 +1201,8 @@ export default { }) for (let i in this.dataArr[0]) { this.chartMsg.series[0].name = this.dataArr[0]['item'] - if (i.search('value') === 0) { + if (i.search('value') === 0) { + console.log("this.dataArr[0]['item']", this.dataArr[0]['item'], this.dataArr[0][i]); this.chartMsg.series[0].data.push({ name: this.dataArr[0]['item'], value: this.dataArr[0][i] @@ -1224,6 +1239,7 @@ export default { } } } + console.log(this.dataArr[0]['item'],this.chartMsg.series[0].data) this.tableData = res.data.length != 0 ? this.dataArr : [] // this.tableProps = otherProps // res.data.list.forEach((ele) => { @@ -1253,7 +1269,7 @@ export default { _setTableHeight() { this.tableH = this.tableHeight(137) / 2 - 70; this.chartHeight = this.tableHeight(137) / 2 - 111; - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "productionSituationTablets") { this.chartNum++; } }, diff --git a/src/views/report/productionYield.vue b/src/views/report/productionYield.vue index 7b27964..7bdfbf2 100644 --- a/src/views/report/productionYield.vue +++ b/src/views/report/productionYield.vue @@ -364,7 +364,7 @@ export default { }, isOpen(val) { - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "productionYield") { this.chartNum++; } }, @@ -507,6 +507,12 @@ export default { async getDataList() { this.otherProps = [] this.chartMsg.xData = [] + this.chartMsg.series[0].data = [] + this.chartMsg.series[1].data = [] + this.chartMsg.series[2].data = [] + this.chartMsg.series[3].data = [] + this.chartMsgYearTarget.series[0].data = [] + this.chartMsgYearTarget.series[1].data = [] let arr = [] this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) this.listQuery.factory = arr @@ -660,7 +666,7 @@ export default { } } } else { - res.data.list.slice.forEach((ele, index) => { + res.data.list.forEach((ele, index) => { let i = index + 1 this.chartMsg.xData.push(ele.titleValue) this.otherProps.push({ @@ -724,18 +730,11 @@ export default { console.log(dataArr) this.tableData = res.data.length != 0 ? dataArr : [] // this.tableProps.push() - this.listQuery.total = res.data.total - if (this.listQuery.total > 0) { - this.tableData.forEach(item => { - item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--' - item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--' - }) - } }, _setTableHeight() { this.tableH = this.tableHeight(137) / 2 - 70; this.chartHeight = this.tableHeight(137) / 2 - 111; - if (this.$route.name === "ChipYieldBM") { + if (this.$route.name === "productionYield") { this.chartNum++; } }, From 5e703350e1a3449398ab3b5c1b9c640c34a4a46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Mon, 24 Jun 2024 10:39:10 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/report/comprehensiveData.vue | 4 +- src/views/report/produceConversion.vue | 12 +++-- src/views/report/productionSituationMW.vue | 10 ++-- .../report/productionSituationTablets.vue | 49 ++++++++++++++++--- src/views/report/productionYield.vue | 8 +-- 5 files changed, 61 insertions(+), 22 deletions(-) diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index 2d9ab0d..92fe0a3 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -27,11 +27,11 @@ + placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> 至 + placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> - - - -