<template>
|
<!-- 制件周转 -->
|
<div id="turnover" class="global-content">
|
<div class="width flex align-center justify-end">
|
<div class="flex width12 align-center margin-right15 justify-end">
|
<label class="color909399 fontsiez1rem">年:</label>
|
<el-date-picker v-model="intimers.year" size="mini" value-format="yyyy" type="year" placeholder="选择年">
|
</el-date-picker>
|
</div>
|
<div class="flex width20 margin-right15 align-center justify-end">
|
<label class="color909399 fontsiez1rem">月:</label>
|
<el-date-picker
|
v-model="intimers.month"
|
type="monthrange"
|
size="mini"
|
value-format="MM"
|
format="MM"
|
range-separator="至"
|
start-placeholder="开始月份"
|
end-placeholder="结束月份"
|
>
|
</el-date-picker>
|
</div>
|
<div class="flex width15 align-center margin-right15 justify-end">
|
<label class="color909399 width40 fontsiez1rem">开始周:</label>
|
<el-select style="width: 55%" v-model="intimers.stWeek" size="mini" clearable placeholder="请选择周">
|
<el-option
|
v-for="(item, index) in startweeklist"
|
:key="index + 'startweek'"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
<div class="flex width15 align-center margin-right15 justify-end">
|
<label class="color909399 width40 fontsiez1rem">结束周:</label>
|
<el-select style="width: 55%" v-model="intimers.edWeek" size="mini" clearable placeholder="请选择周">
|
<el-option
|
v-for="(item, index) in endweeklist"
|
:key="index + 'endtweek'"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
<el-button type="primary" size="mini" @click="inquer">查询</el-button>
|
<el-button type="primary" size="mini" @click="linkto">跳转</el-button>
|
</div>
|
<div class="width height-calc90 overflow margin-top4">
|
<turnover-echart class="width height" :chartData="chartData" :colorList="colorList" />
|
<!-- <div class="width height" ref="taskbeatEcharts"></div> -->
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { GetPartTurnover } from '@/api/reportforms';
|
import TurnoverEchart from '@/views/Home/components/turnoverEchart.vue';
|
export default {
|
data() {
|
return {
|
intimers: {
|
year: '',
|
month: null,
|
stWeek: '',
|
edWeek: ''
|
},
|
startweeklist: [
|
{
|
label: '第一周',
|
value: 1
|
},
|
{
|
label: '第二周',
|
value: 2
|
},
|
{
|
label: '第三周',
|
value: 3
|
},
|
{
|
label: '第四周',
|
value: 4
|
}
|
],
|
endweeklist: [
|
{
|
label: '第一周',
|
value: 1
|
},
|
{
|
label: '第二周',
|
value: 2
|
},
|
{
|
label: '第三周',
|
value: 3
|
},
|
{
|
label: '第四周',
|
value: 4
|
}
|
],
|
chartData: {},
|
colorList: ['#0090FF', '#36CE9E', '#FFC005', '#FF515A', '#8B5CFF', '#00CA69']
|
};
|
},
|
components: { TurnoverEchart },
|
computed: {},
|
mounted() {
|
this.GetPartTurnover();
|
},
|
methods: {
|
inquer() {
|
this.GetPartTurnover();
|
},
|
//跳转
|
linkto() {
|
const { href } = this.$router.resolve({
|
path: '/turnover'
|
});
|
window.open(href, '_blank');
|
},
|
GetPartTurnover() {
|
const { year, stWeek, edWeek } = this.intimers;
|
let stMonth = this.intimers.month ? this.intimers.month[0] : '';
|
let edMonth = this.intimers.month ? this.intimers.month[1] : '';
|
GetPartTurnover({ year, stWeek, edWeek, stMonth: stMonth, edMonth: edMonth }).then(res => {
|
this.chartData = res;
|
});
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
#turnover {
|
::v-deep .el-input__inner {
|
// width: 80%;
|
}
|
}
|
</style>
|