| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <template>
- <div class="record-container">
- <ResultAnalysis />
- </div>
- </template>
- <script>
- let that;
- import { mapGetters } from 'vuex';
- import moment from 'moment';
- import ResultAnalysis from "./ResultAnalysis" // 考核详情组件
- export default {
- components: {
- ResultAnalysis
- },
- data() {
- return {
- reviewPackageId: 0,
- detailInfo: null,
- year: '2025',
- headValue: [],
- options: [{ value: '0', label: '未定义', leaf: false, children: [] },
- { value: '1', label: '年度', leaf: false, children: [] },
- { value: '2', label: '半年度', leaf: false, children: [] },
- { value: '3', label: '季度', leaf: false, children: [] },
- { value: '4', label: '月度', leaf: false, children: [] },
- ], //
- props: {
- value: 'value',
- label: 'label',
- children: 'children',
- lazy: true,
- lazyLoad(node, resolve) {
- that.getAssessTree(node, resolve);
- }
- },
- total: 0,
- loading: false,
- tableData: [],
- deptList: [], // 部门列表 - 树形结构
- dept_list: [], // 部门列表
- selected_dept_ids: [], // 选择的部门列表
- placeholder: "",
- chooseChildren: [],
- noDataText: '暂无数据'
- }
- },
- watch: {
- year(val) {
- this.getRecords()
- },
- headValue(val) {
- if (this.chooseChildren && this.chooseChildren.length > 0) {
- let obj = this.chooseChildren.find(child => child.value == this.headValue[1])
- if (obj) {
- let value = ''
- if (this.headValue[0] && this.headValue[0] == '0') value = "未定义 / "
- if (this.headValue[0] && this.headValue[0] == '1') value = "年度 / "
- if (this.headValue[0] && this.headValue[0] == '2') value = "半年度 / "
- if (this.headValue[0] && this.headValue[0] == '3') value = "季度 / "
- if (this.headValue[0] && this.headValue[0] == '4') value = "月度 / "
- this.placeholder = obj.label || ''
- }
- }
- this.getResultAnalyze()
- },
- },
- created() {
- // that = this;
- // this.getRecords('4'); // 优先获取当月最新考核数据 递归周期类型,获取考核数据,优先按月,季,半年度,年度来调用
- },
-
- computed: {
- ...mapGetters(['user_info']),
- },
- filters: {
- formatDate(val) {
- if (val) return moment(val).format('YYYY-MM-DD')
- else return "--"
- },
- filterProgress(list) {
- if (list && list.length > 0) {
- let sum = 0;
- list.forEach(item => {
- if (item.status == 1) sum += 1 // 完成的个数
- })
- return Number(sum / list.length) * 100
- }
- }
- },
- methods: {
- getAssessTree(node, resolve) {
- if (this.options.length == 0) {
- return
- }
- const { value } = node;
-
- this.chooseChildren = node.children // 用来回显选择的文本
- node.children = []
- let url = `/performance/statistics/cycle/info/${this.user_info.site_id}/${value}`
- this.$axiosUser("get", url, {}).then(res => {
- let { data: { data: { items, cycleType } } } = res
- if (items && items.length > 0) {
- items.forEach(item => {
- item.leaf = true;
- item.label = item.remark
- })
- resolve(items)
- } else {
- resolve([])
- }
-
-
- }).finally(() => {
- // this.tableDataLoad = false;
- });
- },
- getRecords(cycle) {
- if (cycle < 0) {
- cycle = 0
- return
- }
- this.loading = true
- // 周期种类 0-未定义 1-年度 2-半年度 3-季度 4-月度
- let url = `/performance/statistics/cycle/info/${this.user_info.site_id}/${cycle}`
- this.$axiosUser("get", url, {}).then(res => {
- this.loading = false;
- let { data: { data: { items, cycleType } } } = res
- if (items && items.length > 0) {
- items.forEach(item => {
- item.leaf = true
- item.label = item.remark
- })
- this.options[parseInt(cycle)].children = items
-
- this.headValue = [cycle + '', this.options[parseInt(cycle)].children[[0]].value]
- // if (this.headValue[1]) this.placeholder = this.options[parseInt(cycle)].children[[0]].label || ''
- } else {
- this.getRecords(parseInt(cycle) - 1) // 递归周期类型,获取考核数据,优先按月,季,半年度,年度来调用
- }
- })
- },
- getResultAnalyze() {
- this.reviewPackageId = 0
- let url = `/performance/statistics/cycle/${this.user_info.site_id}/${this.headValue[0]}`
- if (!this.headValue[1]) return
- this.$axiosUser("get", url, { value: this.headValue[1]}).then(res => {
- this.detailInfo = res.data.data
- this.reviewPackageId = 1
- })
- },
- }
- };
- </script>
- <style lang="scss">
- .record-container {
- .el-cascader .el-input__inner::placeholder {
- color: #606266;
- /* 设置为你想要的颜色 */
- }
- }
- </style>
- <style scoped="scoped" lang="scss">
- // .el-cascader .el-input{
- // cursor: pointer;
- // // #606266
- // }
- .record-container {
- width: 100%;
- height: 100%;
- background-color: #fff;
- border-radius: 5px;
- display: flex;
- flex-direction: column;
- .title-container {
- display: flex;
- align-items: center;
- .searchBox {
- width: 300px;
- .search-title {
- border-bottom: 1px solid #f1f1f1;
- font-size: 16px;
- font-weight: 700;
- padding: 0 10px;
- padding-bottom: 10px;
- }
- }
- .title {
- font-weight: 700;
- font-size: 16px;
- }
- }
- .search-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- height: 50px;
- padding: 0 10px;
- box-sizing: border-box;
- .btn-box {
- padding: 7px 5px;
- border: 1px solid #DCDFE6;
- border-radius: 4px;
- &:hover {
- cursor: pointer;
- }
- }
- }
- .line {
- width: 100%;
- height: 1px;
- background: #f1f1f1;
- margin-bottom: 10px;
- }
- .main-content {
- width: 100%;
- flex: 1;
- overflow-y: auto;
- /* 设置滚动条的宽度和背景色 */
- &::-webkit-scrollbar {
- width: 6px;
- height: 6px;
- background-color: #f9f9f9;
- }
-
- /* 设置滚动条滑块的样式 */
- &::-webkit-scrollbar-thumb {
- border-radius: 6px;
- background-color: #c1c1c1;
- }
-
- /* 设置滚动条滑块hover样式 */
- &::-webkit-scrollbar-thumb:hover {
- background-color: #a8a8a8;
- }
-
- /* 设置滚动条轨道的样式 */
- &::-webkit-scrollbar-track {
- box-shadow: inset 0 0 5px rgba(87, 175, 187, 0.1);
- border-radius: 6px;
- background: #ededed;
- }
- }
- .no-data-box {
- width: 100%;
- height: 100%;
- padding: 26px 35px;
- background-color: #fff;
- box-sizing: border-box;
- border-radius: 4px;
- img {
- width: 200px;
- height: 200px;
- margin-bottom: 10px;
- }
- }
- }
- </style>
|