修改bug

This commit is contained in:
‘937886381’ 2024-07-26 17:03:09 +08:00
parent 4d8300d213
commit eda007d713
9 changed files with 43 additions and 29 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div ref="navbar" class="navbar" <div ref="navbar" class="navbar"
:style="changeColor ? 'background: rgba(0, 21, 41, 1);boxShadow:0px 1px 8px 0px rgba(0,131,255,0.35);margin-left:20px' : 'margin-left:20px'"> :style="changeColor ? 'background: rgba(0, 21, 41, 1);boxShadow:0px 1px 8px 0px rgba(0,131,255,0.35);' : ''">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" <hamburger style="margin-left: 20px;" id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
@toggleClick="toggleSideBar" /> @toggleClick="toggleSideBar" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" /> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />

View File

@ -6,7 +6,7 @@
:style="{ fontSize: isFullscreen ? '0.85vw' : '0.73vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.85vw' : '0.73vw' }">{{ item.label }}</span>
</div> --> </div> -->
<div id="factoryEnergyChart" style="width: 100%; height: 100%"></div> <div v-if="energyCockpits.length != 0" id="factoryEnergyChart" style="width: 100%; height: 100%"></div>
</div> </div>
</chart-container> </chart-container>
</template> </template>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-30 08:58:39 * @Date: 2024-05-30 08:58:39
* @LastEditTime: 2024-07-25 15:42:47 * @LastEditTime: 2024-07-26 16:48:15
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -58,7 +58,7 @@ export default {
grid: { grid: {
left: "10%", left: "10%",
right: "3%", right: "3%",
bottom: "10%", bottom: "14%",
top: "20%", top: "20%",
// containLabel: true, // containLabel: true,
}, },

View File

@ -13,7 +13,8 @@
<CopilotButton v-for="i in ['目标产量', '计划投入', '实际投入', '实际产出', '废品数量', '待再加工']" :key="i" :label="i" <CopilotButton v-for="i in ['目标产量', '计划投入', '实际投入', '实际产出', '废品数量', '待再加工']" :key="i" :label="i"
:active="i === type" @click="() => $emit('update:type', i)" /> :active="i === type" @click="() => $emit('update:type', i)" />
</div> </div>
<barChartBase :type="type" :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1"></barChartBase> <barChartBase :type="type" :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1">
</barChartBase>
</div> </div>
</div> </div>
@ -114,7 +115,7 @@ export default {
`<span style='color: rgba(223,241,254,.8);font-size:16px' title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || "" `<span style='color: rgba(223,241,254,.8);font-size:16px' title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || ""
}</span>`, }</span>`,
`<span style="display:inline-block;width:45px;color: rgba(223,241,254,.8)">${this.prodOrder[i].productionProgress `<span style="display:inline-block;width:45px;color: rgba(223,241,254,.8)">${this.prodOrder[i].productionProgress
? this.prodOrder[i].productionProgress.toFixed(2) * 100 + "%" ? parseFloat((this.prodOrder[i].productionProgress * 100).toFixed(2)) + "%"
: "0%" : "0%"
}</span> }</span>
<div style="display:inline-block;height:20px;vertical-align:top;margin-top:3px;"> <div style="display:inline-block;height:20px;vertical-align:top;margin-top:3px;">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-07-25 10:10:07 * @Date: 2024-07-25 10:10:07
* @LastEditTime: 2024-07-25 10:44:01 * @LastEditTime: 2024-07-26 16:47:15
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -125,7 +125,7 @@
<div class="chart"> <div class="chart">
<div class="chart-title"> <div class="chart-title">
<span class="title">生产情况</span> <span class="title">生产情况</span>
<div class="button-than" style="position: absolute;right: 3%;"> <div class="button-than" style="position: absolute;right: 0%;">
<CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than" <CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than"
@click="() => $emit('update:than', i)" /> @click="() => $emit('update:than', i)" />
</div> </div>
@ -224,6 +224,7 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.prod-monitor { .prod-monitor {
height: 100%; height: 100%;
display: flex; display: flex;
@ -235,7 +236,7 @@ export default {
position: relative; position: relative;
// gap: 6px; // gap: 6px;
.chart-title{ .chart-title{
margin-top: 5px; margin-top: 20px;
// flex: 1; // flex: 1;
// gap: 6px; // gap: 6px;
height: 1.5vw; height: 1.5vw;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-07-26 11:14:37 * @LastEditTime: 2024-07-26 14:28:19
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -30,8 +30,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> --> <!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData" <base-table :row-key="(record, index) => { return record.in }" border :table-props="tableProps"
:max-height="tableH"> :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData" :max-height="tableH">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
:method-list="tableBtn" @clickBtn="handleClick" /> --> :method-list="tableBtn" @clickBtn="handleClick" /> -->
</base-table> </base-table>
@ -69,13 +69,13 @@ import basicPage from '@/mixins/basic-page'
import { getBaseHeader } from "@/utils/request"; import { getBaseHeader } from "@/utils/request";
import { factoryList } from "@/utils/constants"; import { factoryList } from "@/utils/constants";
import tableHeightMixin from "@/mixins/tableHeightMixin"; // import tableHeightMixin from "@/mixins/tableHeightMixin";
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
// components: { ButtonNav, detailOrUpdate, addOrUpdate }, // components: { ButtonNav, detailOrUpdate, addOrUpdate },
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const startYear = currentYear - 10; const startYear = currentYear - 10;
@ -100,6 +100,7 @@ export default {
end: undefined, end: undefined,
// selectedValues: [], // selectedValues: [],
options, options,
tableH: this.tableHeight(300),
listQuery: { listQuery: {
pageSize: 20, pageSize: 20,
pageNo: 1, pageNo: 1,
@ -282,7 +283,7 @@ export default {
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'CMaterial', prop: 'material',
label: '子项物料名称', label: '子项物料名称',
minWidth: 150, minWidth: 150,
// filter: (val) => factoryList[val], // filter: (val) => factoryList[val],
@ -406,8 +407,10 @@ export default {
await getCostMainPage(this.listQuery).then(res => { await getCostMainPage(this.listQuery).then(res => {
if (res.code === 0) { if (res.code === 0) {
// this.tableData = res.data.list // this.tableData = res.data.list
res.data.list.forEach(item => { res.data.list.forEach((item, index) => {
let obj = { let obj = {
in: Math.random().toString().slice(2, 10),
id:item.id,
yearPhase: item.yearPhase, yearPhase: item.yearPhase,
center: item.center, center: item.center,
product: item.product, product: item.product,
@ -429,12 +432,15 @@ export default {
createTime: item.createTime, createTime: item.createTime,
yearPhaseName: item.yearPhaseName, yearPhaseName: item.yearPhaseName,
project: item.project, project: item.project,
CMaterial: item.material, material: item.material,
children:[]
} }
this.tableData.push(obj) this.tableData.push(obj)
item.children.forEach(ele => { item.children.forEach((ele, ind) => {
// for (let i in item.projs) { // for (let i in item.projs) {
let obj = { let obj = {
in: Math.random().toString().slice(2, 10),
id: ele.id,
yearPhase: ele.yearPhase, yearPhase: ele.yearPhase,
center: ele.center, center: ele.center,
product: ele.product, product: ele.product,
@ -456,12 +462,15 @@ export default {
createTime: ele.createTime, createTime: ele.createTime,
yearPhaseName: ele.yearPhaseName, yearPhaseName: ele.yearPhaseName,
project: ele.project, project: ele.project,
CMaterial: ele.material, material: ele.material,
children:[]
} }
this.tableData.push(obj) this.tableData[index].children.push(obj)
ele.children?.forEach(i => { ele.children?.forEach((i,inde) => {
// for (let i in item.projs) { // for (let i in item.projs) {
let obj = { let obj = {
in: Math.random().toString().slice(2, 10),
id: i.id,
yearPhase: i.yearPhase, yearPhase: i.yearPhase,
center: i.center, center: i.center,
product: i.product, product: i.product,
@ -483,9 +492,9 @@ export default {
createTime: i.createTime, createTime: i.createTime,
yearPhaseName: i.yearPhaseName, yearPhaseName: i.yearPhaseName,
project: i.project, project: i.project,
CMaterial: i.material, material: i.material,
} }
this.tableData.push(obj) this.tableData[index].children[ind].children.push(obj)
// }); // });
// } // }
}); });
@ -494,6 +503,7 @@ export default {
}); });
}); });
console.log(this.tableData);
this.listQuery.total = res.data.total this.listQuery.total = res.data.total
} }
}) })

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-06-19 15:28:34 * @Date: 2024-06-19 15:28:34
* @LastEditTime: 2024-07-12 09:12:10 * @LastEditTime: 2024-07-26 16:43:54
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-07-09 16:06:13 * @Date: 2024-07-09 16:06:13
* @LastEditTime: 2024-07-09 16:14:54 * @LastEditTime: 2024-07-26 16:57:33
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -139,6 +139,7 @@ export default {
height: 3, height: 3,
// //
left: "center", left: "center",
minValueSpan:2,
// //
zoomLoxk: true, zoomLoxk: true,
// //

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-07-26 11:14:34 * @LastEditTime: 2024-07-26 13:58:56
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -86,7 +86,7 @@ import basicPage from '@/mixins/basic-page'
// import addOrUpdate from './add-or-updata'; // import addOrUpdate from './add-or-updata';
// import { factoryList, dhgfactoryList, tyjxfactoryList } from "@/utils/constants"; // import { factoryList, dhgfactoryList, tyjxfactoryList } from "@/utils/constants";
import { getBaseHeader } from "@/utils/request"; import { getBaseHeader } from "@/utils/request";
import tableHeightMixin from "@/mixins/tableHeightMixin"; // import tableHeightMixin from "@/mixins/tableHeightMixin";
import { factoryList } from "@/utils/constants"; import { factoryList } from "@/utils/constants";
@ -94,7 +94,7 @@ import { factoryList } from "@/utils/constants";
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
// components: { ButtonNav, detailOrUpdate, addOrUpdate }, // components: { ButtonNav, detailOrUpdate, addOrUpdate },
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
start: undefined, start: undefined,
@ -109,6 +109,7 @@ export default {
materialName: null, materialName: null,
warehouse: null, warehouse: null,
}, },
tableH: this.tableHeight(300),
// //
mainFormConfig: [ mainFormConfig: [
{ {