|
@@ -34,7 +34,7 @@
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
<span>不良品分布图</span>
|
|
<span>不良品分布图</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <v-chart ref="pieRef" style="height: 100%" :option="pieOption" />
|
|
|
|
|
|
|
+ <v-chart ref="pieRef" style="height: 100%" :option="pieOptions" />
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24" style="height: 43%; margin-top: 15px">
|
|
<el-col :span="24" style="height: 43%; margin-top: 15px">
|
|
@@ -57,229 +57,240 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
-import { pieOption, barOption, columns } from './data';
|
|
|
|
|
-import { use } from 'echarts/core';
|
|
|
|
|
-import { CanvasRenderer } from 'echarts/renderers';
|
|
|
|
|
-import { BarChart, PieChart, LineChart } from 'echarts/charts';
|
|
|
|
|
-import {
|
|
|
|
|
- GridComponent,
|
|
|
|
|
- TooltipComponent,
|
|
|
|
|
- LegendComponent
|
|
|
|
|
-} from 'echarts/components';
|
|
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ import { pieOption, barOption, columns, pieOptions } from './data';
|
|
|
|
|
+ import { use } from 'echarts/core';
|
|
|
|
|
+ import { CanvasRenderer } from 'echarts/renderers';
|
|
|
|
|
+ import { BarChart, PieChart, LineChart } from 'echarts/charts';
|
|
|
|
|
+ import {
|
|
|
|
|
+ GridComponent,
|
|
|
|
|
+ TooltipComponent,
|
|
|
|
|
+ LegendComponent
|
|
|
|
|
+ } from 'echarts/components';
|
|
|
|
|
|
|
|
-import VChart from 'vue-echarts';
|
|
|
|
|
-import { echartsMixin } from '@/utils/echarts-mixin';
|
|
|
|
|
-import { getCount, getCompletionCount, getOrderList } from '@/api/mes/index'
|
|
|
|
|
-// 按需加载 echarts
|
|
|
|
|
-use([
|
|
|
|
|
- CanvasRenderer,
|
|
|
|
|
- BarChart,
|
|
|
|
|
- PieChart,
|
|
|
|
|
- GridComponent,
|
|
|
|
|
- TooltipComponent,
|
|
|
|
|
- LegendComponent,
|
|
|
|
|
- LineChart
|
|
|
|
|
-]);
|
|
|
|
|
-export default {
|
|
|
|
|
- mixins: [dictMixins, echartsMixin(['pieRef', 'barRef'])],
|
|
|
|
|
- components: { VChart },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- columns,
|
|
|
|
|
- arr: [
|
|
|
|
|
- {
|
|
|
|
|
- name: '生产总数',
|
|
|
|
|
- num: '188',
|
|
|
|
|
- imgUrl: require('../../assets/Group1.png'),
|
|
|
|
|
- unit: ''
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '待生产数量',
|
|
|
|
|
- num: '188',
|
|
|
|
|
- imgUrl: require('../../assets/Group2.png'),
|
|
|
|
|
- unit: ''
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '已完成数量',
|
|
|
|
|
- num: '188',
|
|
|
|
|
- imgUrl: require('../../assets/Group3.png'),
|
|
|
|
|
- unit: ''
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '生产中数量',
|
|
|
|
|
- num: '188',
|
|
|
|
|
- imgUrl: require('../../assets/Group4.png'),
|
|
|
|
|
- unit: '',
|
|
|
|
|
- color: '#f97876'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ import VChart from 'vue-echarts';
|
|
|
|
|
+ import { echartsMixin } from '@/utils/echarts-mixin';
|
|
|
|
|
+ import { getCount, getCompletionCount, getOrderList,queryProportionDefectiveTypes } from '@/api/mes/index';
|
|
|
|
|
+ // 按需加载 echarts
|
|
|
|
|
+ use([
|
|
|
|
|
+ CanvasRenderer,
|
|
|
|
|
+ BarChart,
|
|
|
|
|
+ PieChart,
|
|
|
|
|
+ GridComponent,
|
|
|
|
|
+ TooltipComponent,
|
|
|
|
|
+ LegendComponent,
|
|
|
|
|
+ LineChart
|
|
|
|
|
+ ]);
|
|
|
|
|
+ export default {
|
|
|
|
|
+ mixins: [dictMixins, echartsMixin(['pieRef', 'barRef'])],
|
|
|
|
|
+ components: { VChart },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ columns,
|
|
|
|
|
+ arr: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '生产总数',
|
|
|
|
|
+ num: '188',
|
|
|
|
|
+ imgUrl: require('../../assets/Group1.png'),
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '待生产数量',
|
|
|
|
|
+ num: '188',
|
|
|
|
|
+ imgUrl: require('../../assets/Group2.png'),
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '已完成数量',
|
|
|
|
|
+ num: '188',
|
|
|
|
|
+ imgUrl: require('../../assets/Group3.png'),
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '生产中数量',
|
|
|
|
|
+ num: '188',
|
|
|
|
|
+ imgUrl: require('../../assets/Group4.png'),
|
|
|
|
|
+ unit: '',
|
|
|
|
|
+ color: '#f97876'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
|
|
|
- pieOption: {},
|
|
|
|
|
- barOption: {},
|
|
|
|
|
- form: {
|
|
|
|
|
- finishTime: '',
|
|
|
|
|
- timeType: '1'
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ pieOption: {},
|
|
|
|
|
+ barOption: {},
|
|
|
|
|
+ pieOptions: {},
|
|
|
|
|
+ form: {
|
|
|
|
|
+ finishTime: '',
|
|
|
|
|
+ timeType: '1'
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- created() {
|
|
|
|
|
- this.pieOption = pieOption([
|
|
|
|
|
- { value: 40, name: ' 外观检测' },
|
|
|
|
|
- { value: 30, name: ' 尺寸检测' },
|
|
|
|
|
- { value: 15, name: ' 性能检测' },
|
|
|
|
|
- { value: 10, name: ' 密度检测' },
|
|
|
|
|
- { value: 5, name: ' 重量检测' }
|
|
|
|
|
- ]);
|
|
|
|
|
-
|
|
|
|
|
- this.getCount();
|
|
|
|
|
- this.getCompletionCount();
|
|
|
|
|
- },
|
|
|
|
|
- mounted(){
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$refs.barRef.resize();
|
|
|
|
|
- this.$refs.pieRef.resize();
|
|
|
|
|
- }, 300);
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- datasource({page, where, limit}) {
|
|
|
|
|
- where.factoriesId = 0;
|
|
|
|
|
- return getOrderList({
|
|
|
|
|
- ...where,
|
|
|
|
|
- pageNum: page,
|
|
|
|
|
- size: limit
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ // this.pieOption = pieOption([
|
|
|
|
|
+ // { value: 40, name: ' 外观检测' },
|
|
|
|
|
+ // { value: 30, name: ' 尺寸检测' },
|
|
|
|
|
+ // { value: 15, name: ' 性能检测' },
|
|
|
|
|
+ // { value: 10, name: ' 密度检测' },
|
|
|
|
|
+ // { value: 5, name: ' 重量检测' }
|
|
|
|
|
+ // ]);
|
|
|
|
|
|
|
|
|
|
+ this.getCount();
|
|
|
|
|
+ this.getCompletionCount();
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- //首页统计
|
|
|
|
|
- async getCount() {
|
|
|
|
|
- let rest = await getCount({factoriesId: 0});
|
|
|
|
|
- this.arr.forEach((item, index) => {
|
|
|
|
|
- if (item.name === '生产总数') {
|
|
|
|
|
- item.num = rest.formingNum || 0;
|
|
|
|
|
- } else if (item.name === '待生产数量') {
|
|
|
|
|
- item.num = rest.pendingProductionCount || 0;
|
|
|
|
|
- } else if (item.name === '已完成数量') {
|
|
|
|
|
- item.num = rest.formedNum || 0;
|
|
|
|
|
- } else if (item.name === '生产中数量') {
|
|
|
|
|
- item.num = rest.inProgressWorkOrderCount || 0;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // console.log(rest, 'rest');
|
|
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.proportion();
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$refs.barRef.resize();
|
|
|
|
|
+ this.$refs.pieRef.resize();
|
|
|
|
|
+ }, 300);
|
|
|
},
|
|
},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async proportion() {
|
|
|
|
|
+ const res = await queryProportionDefectiveTypes();
|
|
|
|
|
+ let list = res.map((el) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ value: el.unQualifiedNumber,
|
|
|
|
|
+ name: el.categoryLevelClassName
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ this.pieOptions = pieOptions(list);
|
|
|
|
|
+ console.log(res, 'res ----');
|
|
|
|
|
+ },
|
|
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
|
|
+ where.factoriesId = 0;
|
|
|
|
|
+ return getOrderList({
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ timeTypeChange(){},
|
|
|
|
|
+ //首页统计
|
|
|
|
|
+ async getCount() {
|
|
|
|
|
+ let rest = await getCount({ factoriesId: 0 });
|
|
|
|
|
+ this.arr.forEach((item, index) => {
|
|
|
|
|
+ if (item.name === '生产总数') {
|
|
|
|
|
+ item.num = rest.formingNum || 0;
|
|
|
|
|
+ } else if (item.name === '待生产数量') {
|
|
|
|
|
+ item.num = rest.pendingProductionCount || 0;
|
|
|
|
|
+ } else if (item.name === '已完成数量') {
|
|
|
|
|
+ item.num = rest.formedNum || 0;
|
|
|
|
|
+ } else if (item.name === '生产中数量') {
|
|
|
|
|
+ item.num = rest.inProgressWorkOrderCount || 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // console.log(rest, 'rest');
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- //工单完成统计
|
|
|
|
|
- async getCompletionCount() {
|
|
|
|
|
- let params = {
|
|
|
|
|
- startDate: new Date().getFullYear() + '-01-01',
|
|
|
|
|
- endDate: new Date().getFullYear() + '-12-31',
|
|
|
|
|
- factoriesId: 0,
|
|
|
|
|
- }
|
|
|
|
|
- let rest = await getCompletionCount(params);
|
|
|
|
|
- let inWarehouseCountList = []; //入库数量
|
|
|
|
|
- let inProductCountList = []; //在制工单数
|
|
|
|
|
- for (let i = 0; i < rest.length; i++) {
|
|
|
|
|
- inWarehouseCountList.push(rest[i].inWarehouseCount)
|
|
|
|
|
- inProductCountList.push(rest[i].inProductCountList)
|
|
|
|
|
- }
|
|
|
|
|
- this.barOption = barOption(
|
|
|
|
|
- [
|
|
|
|
|
|
|
+ //工单完成统计
|
|
|
|
|
+ async getCompletionCount() {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ startDate: new Date().getFullYear() + '-01-01',
|
|
|
|
|
+ endDate: new Date().getFullYear() + '-12-31',
|
|
|
|
|
+ factoriesId: 0
|
|
|
|
|
+ };
|
|
|
|
|
+ let rest = await getCompletionCount(params);
|
|
|
|
|
+ let inWarehouseCountList = []; //入库数量
|
|
|
|
|
+ let inProductCountList = []; //在制工单数
|
|
|
|
|
+ for (let i = 0; i < rest.length; i++) {
|
|
|
|
|
+ inWarehouseCountList.push(rest[i].inWarehouseCount);
|
|
|
|
|
+ inProductCountList.push(rest[i].inProductCountList);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.barOption = barOption([
|
|
|
{
|
|
{
|
|
|
name: '工单入库数量',
|
|
name: '工单入库数量',
|
|
|
barWidth: '25%',
|
|
barWidth: '25%',
|
|
|
data: inWarehouseCountList,
|
|
data: inWarehouseCountList,
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
yAxisIndex: 0 // 使用第一个Y轴
|
|
yAxisIndex: 0 // 使用第一个Y轴
|
|
|
- }, {
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
name: '工单数',
|
|
name: '工单数',
|
|
|
symbolSize: 10,
|
|
symbolSize: 10,
|
|
|
data: inProductCountList,
|
|
data: inProductCountList,
|
|
|
- type: 'line', smooth: true,
|
|
|
|
|
|
|
+ type: 'line',
|
|
|
|
|
+ smooth: true,
|
|
|
itemStyle: {
|
|
itemStyle: {
|
|
|
color: '#ffab08'
|
|
color: '#ffab08'
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
]);
|
|
]);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.clearfix {
|
|
|
|
|
- font-size: 0.7vw;
|
|
|
|
|
-
|
|
|
|
|
- > span {
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- }
|
|
|
|
|
- :deep(.el-radio-button__inner) {
|
|
|
|
|
|
|
+ .clearfix {
|
|
|
font-size: 0.7vw;
|
|
font-size: 0.7vw;
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-.ele-body {
|
|
|
|
|
- height: calc(100vh - 111px);
|
|
|
|
|
- > .el-row {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- }
|
|
|
|
|
- .el-card {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- :deep(.el-card__body) {
|
|
|
|
|
- padding: 0.3vw;
|
|
|
|
|
- }
|
|
|
|
|
- :deep(.el-card__header) {
|
|
|
|
|
- padding: 0.8vw;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ > span {
|
|
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-card__body) {
|
|
|
|
|
- height: calc(100% - 1.6vw - 39px);
|
|
|
|
|
|
|
+ :deep(.el-radio-button__inner) {
|
|
|
|
|
+ font-size: 0.7vw;
|
|
|
}
|
|
}
|
|
|
- :deep(.ele-pro-table) {
|
|
|
|
|
- height: 99%;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ .ele-body {
|
|
|
|
|
+ height: calc(100vh - 111px);
|
|
|
|
|
+ > .el-row {
|
|
|
|
|
+ height: 100%;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-table) {
|
|
|
|
|
- font-size: 0.65vw;
|
|
|
|
|
|
|
+ .el-card {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ :deep(.el-card__body) {
|
|
|
|
|
+ padding: 0.3vw;
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.el-card__header) {
|
|
|
|
|
+ padding: 0.8vw;
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.el-card__body) {
|
|
|
|
|
+ height: calc(100% - 1.6vw - 39px);
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.ele-pro-table) {
|
|
|
|
|
+ height: 99%;
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.el-table) {
|
|
|
|
|
+ font-size: 0.65vw;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
-.item {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
- margin-top: 15px;
|
|
|
|
|
- > div {
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- margin-left: 15px;
|
|
|
|
|
- background: url(../../assets/item_frame.png) no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
|
|
+ .item {
|
|
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 12px;
|
|
|
|
|
- img {
|
|
|
|
|
- width: 2.3vw;
|
|
|
|
|
- // height:1.7vw;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
|
+ margin-top: 15px;
|
|
|
> div {
|
|
> div {
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-left: 15px;
|
|
|
|
|
+ background: url(../../assets/item_frame.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
|
|
- // margin-left: 0.8vw;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- width: 80%;
|
|
|
|
|
- span:nth-of-type(1) {
|
|
|
|
|
- font-size: 0.75vw;
|
|
|
|
|
|
|
+ padding: 12px;
|
|
|
|
|
+ img {
|
|
|
|
|
+ width: 2.3vw;
|
|
|
|
|
+ // height:1.7vw;
|
|
|
}
|
|
}
|
|
|
- span:nth-of-type(2) {
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- font-size: 1.2vw;
|
|
|
|
|
- margin-top: 0.8vw;
|
|
|
|
|
- span {
|
|
|
|
|
- font-size: 0.7vw;
|
|
|
|
|
|
|
+ > div {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ // margin-left: 0.8vw;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 80%;
|
|
|
|
|
+ span:nth-of-type(1) {
|
|
|
|
|
+ font-size: 0.75vw;
|
|
|
|
|
+ }
|
|
|
|
|
+ span:nth-of-type(2) {
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ font-size: 1.2vw;
|
|
|
|
|
+ margin-top: 0.8vw;
|
|
|
|
|
+ span {
|
|
|
|
|
+ font-size: 0.7vw;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
</style>
|
|
</style>
|
|
|
-
|
|
|
|
|
-
|
|
|