wtt
2026-01-15 aaa40084e725685366a63f88b9d5b98eaaf3c34e
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
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待维修</view>
            <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">已维修</view>
            <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">全部任务</view>
        </view>
 
        <!-- 设备维修任务列表列表 -->
        <view class="list" v-for="(item,index) in reportBillsDisplay" :key="index">
            <uni-card :title="item.故障登记单号" :extra="`日期: ${dayjs(item.器具故障日期).format('YYYY-MM-DD')}`" style="margin: 10px;">
                <view class="card-detail">
                    <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)" :key="index">
                        <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}}
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="reportBillsDisplay.length == 0">暂无数据</view>
    </view>
</template>
 
<script>
    import {
        getUserInfo
    } from '../../../utils/auth';
    import {
        CommonUtils
    } from '../../../utils/common';
    import dayjs from 'dayjs';
    export default {
        // 设备维修任务 模块
        name: 'Sb_EquipRepairTaskReport',
        data() {
            return {
                dayjs,
                CommonUtils,
                tabs: 0,
                reportBillsDisplay: [],
                reportBillsAwaitRepair: [], // 待维修
                reportBillsRepaired: [], // 已维修
                reportBillsAll: [], // 全部任务
                HFieldList: [], // 字段列表
            };
        },
        methods: {
            switchTab(tabIndex) {
                this.tabs = tabIndex
                switch (tabIndex) {
                    case 0:
                        this.reportBillsDisplay = this.reportBillsAwaitRepair;
                        break;
                    case 1:
                        this.reportBillsDisplay = this.reportBillsRepaired;
                        break;
                    case 2:
                        this.reportBillsDisplay = this.reportBillsAll;
                        break;
                }
            },
            async getRepairList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: 'Sc_MouldRepairTaskReport/RepairList',
                        data: {
                            user: getUserInfo()["Czymc"]
                        }
                    })
 
                    let {
                        count,
                        data,
                        Message,
                        list
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
 
                        this.reportBillsAwaitRepair = data.h_p_Sc_MouldRepairTaskReport
                        this.reportBillsRepaired = data.h_p_Sc_MouldRepairTaskReport1
                        this.reportBillsAll = data.h_p_Sc_MouldRepairTaskReport2
                        
                        let fieldList = CommonUtils.fieldListFilterRole({
                            ExcludeKeys: ['故障登记单号', '器具故障日期'],
                            FieldList: list
                        })
                        
                        if (fieldList.status == false) {
                            CommonUtils.showTips({
                                title: '温馨提示',
                                message: `获取表单结构失败: ${fieldList.Message}`
                            })
                        }
                        
                        this.HFieldList = fieldList.data
 
                        this.switchTab(0)
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取维修单异常: ${Message}`
                        })
                    }
 
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取维修单异常: ${err}`
                    })
                }
            }
        },
        onLoad() {
            this.getRepairList()
        }
    }
</script>
 
<style lang="scss">
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>