yudao-dev/src/views/group/monitoring/teamProduction/index.vue

157 lines
3.3 KiB
Vue
Raw Normal View History

2023-10-24 15:16:20 +08:00
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 查看生产情况 -->
2023-10-30 10:26:54 +08:00
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
2023-10-24 15:16:20 +08:00
</div>
</template>
<script>
2023-10-30 10:26:54 +08:00
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
2023-10-24 15:16:20 +08:00
import { parseTime } from '@/utils/ruoyi'
2023-10-30 10:26:54 +08:00
import TeamProductionDetail from './components/teamProductionDetail'
2023-10-24 15:16:20 +08:00
const tableProps = [
{
prop: 'createTime',
label: '排班创建时间',
filter: parseTime
},
{
prop: 'startDay',
label: '上班日期'
},
{
prop: 'startTime',
label: '上班时间',
filter: parseTime
},
{
prop: 'endTime',
label: '下班时间',
filter: parseTime
},
{
prop: 'classesName',
label: '班次名称'
},
{
prop: 'teamName',
label: '班组名称'
}
]
const tableBtn = [
{
type: 'viewDetail',
btnName: '查看生产情况'
}
]
export default {
name: 'GroupTeamScheduling',
data() {
return {
formConfig: [
{
type: 'select',
label: '班次信息',
selectOptions: [],
param: 'classesId'
},
{
type: 'input',
label: '班组信息',
placeholder: '班组信息',
param: 'teamName'
},
{
type: 'datePicker',
label: '上班日期',
dateType: 'date',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
param: 'startDay',
defaultSelect: '',
width: 200
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 20,
classesId: '',
teamName: '',
startDay: ''
},
tableProps,
tableBtn,
list: [],
tableH: this.tableHeight(220),
total: 0,
paramVisible: false
}
},
2023-10-30 10:26:54 +08:00
components: { TeamProductionDetail },
2023-10-24 15:16:20 +08:00
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220)
})
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.cnName = val.cnName
this.getList()
},
getList() {
groupTeamSchedulingPage().then(res => {
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0
})
2023-10-30 10:26:54 +08:00
},
getGroupClass() {
2023-10-24 15:16:20 +08:00
},
handleClick(val) {
console.log(val)
this.paramVisible = true
this.$nextTick(() => {
2023-10-30 10:26:54 +08:00
this.$refs.schedulingMonitoringDetail.init(val.data)
2023-10-24 15:16:20 +08:00
})
}
}
}
</script>