gaoshp
2024-04-17 deb83d55cd15cad208e6721cb90947c56bf3cab5
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
<!--
 * @Date: 2024-04-09 20:19:46
 * @LastEditors: Sneed
 * @LastEditTime: 2024-04-09 21:57:50
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/Shiftsystem.vue
-->
<template>
    <el-container>
        <el-aside width="320px">
            <el-button type="primary" @click="add">新建班制</el-button>
            <el-table :data="tableData" stripe style="width: 100%" @row-click="rowClick">
                <el-table-column prop="code" label="班制编号" />
                <el-table-column prop="name" label="班制名称" />
            </el-table>
        </el-aside>
        <el-container>
            <ul>
                <li>
                    <span>班制编号</span>
                    {{ info.code }}
                </li>
                <li>
                    <span>班制颜色</span>
                    {{ info.code }}
                </li>
                <li>
                    <span>开始-结束时间</span>
                    {{ info.code }}
                </li>
            </ul>
        </el-container>
        <Dialog ref="dialog" :option="{types,status,group}"></Dialog>
    </el-container>
</template>
 
<script>
import Dialog from './Dialog.vue'
export default {
    components: {
        Dialog
    },
    data () {
        return {
            tableData: [],
            info: {
                code: ''
            }
        }
    },
    created () {
        this.$API.calender.getShiftsystemList.post({params: {current:1,size: 15},data: {
            code: "",name: "",statusList: [1]
        }}).then(res => {
            this.tableData = res?.data?.records || []
            let current = this.tableData?.[0] || ''
            current.id && this.rowClick(current)
        })
    },
    methods: {
        rowClick(row) {
            console.log(row)
            this.$API.calender.getShiftsystemInfo.get({id: row.id}).then(res => {
                console.log(res.data)
                this.info = res.data
            })
        },
        add () {
            this.$refs.dialog.open()
        }
    },
}
</script>
 
<style lang="scss" scoped></style>