shuishen
2023-04-09 85fb13abbeadc1765d2c0056ba99c6c19aa35dfd
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
145
146
147
148
149
<template>
    <!-- 值班table -->
    <div>
        <el-dialog :title="schedulingTitle" :visible.sync="schedulingVisible" :before-close="schedulingBeforeClose"
            :modal-append-to-body="false" :modal="true" :close-on-click-modal="false" class="area-details-box">
            <div class="header">
                <div>
                    <span>值班人:</span>
                    <input type="text" v-model="person" placeholder="请输入值班人" />
                    <span style="margin-left: 10px;">值班人电话:</span>
                    <input type="text" v-model="contact" placeholder="请输入值班人电话" />
                </div>
                <el-button type="primary" icon="el-icon-search" @click="searchScheduling">搜索</el-button>
                <el-button type="primary" icon="el-icon-delete" @click="clearSearchScheduling">清空</el-button>
            </div>
            <el-main v-loading="chedulingLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0.5)">
                <el-table :data="schedulingTableData" style="width: 100%"
                    :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                    :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'default' }">
                    <el-table-column label="序号" type="index" align="center">
                        <template slot-scope="scope">
                            <span>{{ (page.currentPage - 1) * page.pageSize + scope.$index + 1 }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="day" label="值班日期"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="dept" label="值班单位"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="person" label="值班人员"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="contact" label="值班人员电话"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="type" label="值班类型"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="leads" label="带班领导"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="leadContact" label="带班领导电话"></el-table-column>
                </el-table>
 
                <div class="pages all-pagination-sty">
                    <el-pagination background layout="prev, pager, next, total" :page-size="page.pageSize"
                        :total="page.total" :current-page="page.currentPage"
                        @current-change="handleCurrentChange"></el-pagination>
                </div>
            </el-main>
 
        </el-dialog>
    </div>
</template>
<script>
import { getSchedulingList } from '@/api/home/index'
export default {
    name: "schedulingList",
    data () {
        return {
            person: '',
            chedulingLoading: false,
            contact: '',
            // 值班搜索条件
            schedulingSearchVal: '',
            // 现有值班表格
            schedulingTableData: [],
            schedulingCurrentSelect: {},
            // 值班分页
            page: {
                currentPage: 1,
                pageSize: 15,
                total: 0
            },
            schedulingVisible: false,
            schedulingTitle: '',
            dept: ''
        }
    },
    methods: {
        //初始化
        init (data) {
            this.schedulingVisible = true
            this.chedulingLoading = true
            this.schedulingTitle = data.name + "值班信息"
            this.dept = data.dept
            this.getSchedulingtPaging()
        },
        /**
         * @description:列表弹窗关闭的事件
         * @return {*}
         */
        schedulingBeforeClose () {
            this.page.currentPage = 1
            this.person = ''
            this.contact = ''
            this.dept = ""
            this.schedulingTableData = []
            this.schedulingVisible = false
        },
        /**
         * @description: 值班查询
         * @return {*}
         */
        searchScheduling () {
            this.chedulingLoading = true
            this.page.currentPage = 1
            this.getSchedulingtPaging()
        },
 
        /**
         * @description: 值班查询清空
         * @return {*}
         */
        clearSearchScheduling () {
            this.chedulingLoading = true
            this.page.currentPage = 1
            this.person = ''
            this.contact = ''
            this.getSchedulingtPaging()
        },
        // 值班分页查询
        handleCurrentChange: function (currentPage) {
            this.page.currentPage = currentPage
            this.getSchedulingtPaging()
        },
 
        // 获取值班分页数据
        getSchedulingtPaging (params = {}) {
            var values = {
                sameday: 1,
                person: this.person,
                contact: this.contact,
                dept: this.dept
            }
            getSchedulingList(
                this.page.currentPage,
                this.page.pageSize,
                values).then(res => {
                    this.schedulingTableData = []
                    this.page.total = 0
                    if (res.data.data.total > 0) {
                        this.schedulingTableData = res.data.data.records
                        this.page.total = res.data.data.total
                    }
                    setTimeout(() => {
                        this.chedulingLoading = false
                    }, 500)
                })
        },
    }
}
</script>
 
<style scoped lang="scss">
.global-dialog-seat {
    height: countSizeVh(700);
}
</style>