| | |
| | | top="-50px" |
| | | > |
| | | <el-table |
| | | ref="table" |
| | | :data="tableData" |
| | | border |
| | | style="width: 100%" |
| | |
| | | import ColumnarChart from "../../components/StatisticsComponent/ColumnarChart" |
| | | import mixCart from "../../components/StatisticsComponent/mixCart" |
| | | import {getStatisticAnalysis} from "@/api/statistic/chart" |
| | | import {getList} from "@/api/system/statistic"; |
| | | |
| | | export default { |
| | | components: { |
| | | lineChart, |
| | |
| | | name: "statisticPage", |
| | | data() { |
| | | return { |
| | | menuList:[], |
| | | dataKeyList: [], |
| | | addVisible: false, |
| | | chartName: "", |
| | | lineList: [], |
| | |
| | | columnarList: [], |
| | | mixList: [], |
| | | selectData: [], |
| | | tableData: [ |
| | | { |
| | | menuName: "工艺文件", |
| | | codeType: "1", |
| | | menuData: [ |
| | | [222, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "测试sc", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "产品型号", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "固定资产", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "李航主数据", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "Part", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "人员主数据", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "人员", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "标准", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "物品主数据", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | }, |
| | | { |
| | | menuName: "型号", |
| | | codeType: null, |
| | | menuData: [ |
| | | [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], |
| | | [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80], |
| | | ] |
| | | } |
| | | ] |
| | | tableData: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getMasterList() |
| | | }, |
| | | methods: { |
| | | getMasterList() { |
| | | const userId = localStorage.getItem('userId'); |
| | | getList({userId: userId}).then(res => { |
| | | this.tableData = res.data.data; |
| | | }) |
| | | }, |
| | | //新增 |
| | | addHandler() { |
| | | this.addVisible = true; |
| | | getStatisticAnalysis({btmNames:'part'} ).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | //取消 |
| | | escHandler() { |
| | |
| | | this.$message.warning("请检查已勾选数据类型是否为空!"); |
| | | return; |
| | | } |
| | | this.selectData.forEach(item => { |
| | | this.dataKeyList = this.selectData.map(obj => obj.code) |
| | | const btmName = this.dataKeyList.join(","); |
| | | if (btmName) { |
| | | getStatisticAnalysis({btmNames:btmName} ).then(res=>{ |
| | | this.menuList = res.data.data; |
| | | this.$message.success('保存成功') |
| | | }) |
| | | |
| | | } |
| | | this.selectData.forEach((item,index) => { |
| | | item.menuData = this.menuList[index].menuData; |
| | | const dataKey = typeList[item.codeType]; |
| | | if (dataKey) { |
| | | this[dataKey].push(item); |
| | | hasValidData = true; // 标记有有效数据被添加 |
| | | hasValidData = true; |
| | | } |
| | | }); |
| | | |
| | | if (hasValidData) { |
| | | // this.$refs.table.clearSelection(); |
| | | this.addVisible = false; |
| | | } |
| | | }, |
| | | //表格多选 |
| | | selectChange(selection, row) { |
| | | // console.log(selection, row) |
| | | selectChange(selection) { |
| | | this.selectData = selection; |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |