Fixiaobai
2023-10-13 e8308ddac0ba4a1f406e8f63d7e6b6f2541cb770
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
<template>
    <el-dialog
        append-to-body
        title="操作记录"
        @close="$emit('update:currshowlist', false)"
        :visible.sync="innerVisible"
        :show="currshowlist">
        <el-row>
            <el-col :span="24" style="height: 400px">
                <el-table stripe ref="operatingRecordList" :data="operatingRecordList"
                          height="100%"
                          :row-style="{height: '26px'}" :cell-style="{padding: '0'}">
                    <el-table-column label="操作者" prop="operator" align="center" min-width="75px"
                                     :show-overflow-tooltip="true"/>
                    <el-table-column label="操作者名称" prop="operatorName" align="center" min-width="75px"
                                     :show-overflow-tooltip="true"/>
                    <el-table-column label="操作时间" prop="operatingTime" align="center" min-width="75px"
                                     :show-overflow-tooltip="true"/>
                    <el-table-column label="操作类型" prop="operationType" align="center" min-width="75px"
                                     :show-overflow-tooltip="true"/>
                </el-table>
            </el-col>
        </el-row>
        <span slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取消</el-button>
    </span>
    </el-dialog>
</template>
 
<script>
    import {getOperatingRecord} from '@/api/product/dutyrecord'
 
    export default {
        props: {
            currshowlist: {
                type: Boolean,
                default: false
            },
            currentDutyRecord: {
                type: Object,
                default: null
            },
        },
        data() {
            return {
                innerVisible: false,
                operatingRecordList: [],
            }
        },
        methods: {
            selectDutyDate(dutyDate) {
                let shift = this.shifts.find(item => item.id === this.dataForm.shiftId)
                if (shift) {
                    this.autoValue(shift, dutyDate)
                }
            }
        },
        watch: {
            currshowlist() {
                this.innerVisible = this.currshowlist
                if (this.currshowlist) {
                    this.$nextTick(() => {
                        if (this.currentDutyRecord && this.currentDutyRecord.id) {
                            getOperatingRecord(this.currentDutyRecord.id).then((response) => {
                                this.operatingRecordList = response.data.data
                            })
                        } else {
                            this.operatingRecordList = []
                        }
                    })
                }
            },
        },
    }
</script>