<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>
|