add
yirongjin
2025-07-23 4a7f6e608d9e16d5f508829f53a001684467a99f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<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>