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

172 lines
4.0 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-11-03 16:59:07 +08:00
import { groupTeamSchedulingPage, groupClassesListAll } 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: '排班创建时间',
2023-11-03 16:59:07 +08:00
filter: parseTime,
minWidth: 150
2023-10-24 15:16:20 +08:00
},
{
prop: 'startDay',
2023-11-03 16:59:07 +08:00
label: '上班日期',
minWidth: 100
2023-10-24 15:16:20 +08:00
},
{
prop: 'startTime',
label: '上班时间',
2023-11-03 16:59:07 +08:00
filter: parseTime,
minWidth: 150
2023-10-24 15:16:20 +08:00
},
{
prop: 'endTime',
label: '下班时间',
2023-11-03 16:59:07 +08:00
filter: parseTime,
minWidth: 150
2023-10-24 15:16:20 +08:00
},
{
prop: 'classesName',
2023-11-03 16:59:07 +08:00
label: '班次名称',
showOverflowtooltip: true
2023-10-24 15:16:20 +08:00
},
{
prop: 'teamName',
2023-11-03 16:59:07 +08:00
label: '班组名称',
showOverflowtooltip: true
2023-10-24 15:16:20 +08:00
}
]
export default {
name: 'GroupTeamScheduling',
data() {
return {
formConfig: [
{
type: 'select',
label: '班次信息',
selectOptions: [],
param: 'classesId'
},
{
type: 'input',
label: '班组信息',
placeholder: '班组信息',
param: 'teamName'
},
{
type: 'datePicker',
label: '上班日期',
2023-11-07 15:49:07 +08:00
dateType: 'daterange',
2023-11-03 16:59:07 +08:00
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
2023-11-07 15:49:07 +08:00
rangeSeparator: '-',
2023-11-03 16:59:07 +08:00
// valueFormat: "timestamp",
2023-11-07 15:49:07 +08:00
param: 'tiemStr',
2023-10-24 15:16:20 +08:00
defaultSelect: '',
2023-11-07 15:49:07 +08:00
width: 250
2023-10-24 15:16:20 +08:00
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 20,
classesId: '',
teamName: '',
2023-11-07 15:49:07 +08:00
startDay: []
2023-10-24 15:16:20 +08:00
},
tableProps,
2023-11-07 15:49:07 +08:00
tableBtn: [
this.$auth.hasPermi('base:team-production:detail')
? {
type: 'viewDetail',
btnName: '查看生产情况'
}
: undefined
].filter((v) => v),
2023-10-24 15:16:20 +08:00
list: [],
2023-11-03 16:59:07 +08:00
tableH: this.tableHeight(260),
2023-10-24 15:16:20 +08:00
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', () => {
2023-11-03 16:59:07 +08:00
this.tableH = this.tableHeight(260)
2023-10-24 15:16:20 +08:00
})
2023-11-03 16:59:07 +08:00
this.getGroupClass()
2023-10-24 15:16:20 +08:00
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
2023-11-03 16:59:07 +08:00
this.queryParams.classesId = val.classesId
this.queryParams.teamName = val.teamName
2023-11-07 15:49:07 +08:00
this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : ''
this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : ''
2023-10-24 15:16:20 +08:00
this.getList()
},
getList() {
2023-11-03 16:59:07 +08:00
groupTeamSchedulingPage({...this.queryParams}).then(res => {
2023-10-24 15:16:20 +08:00
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0
})
2023-10-30 10:26:54 +08:00
},
getGroupClass() {
2023-11-03 16:59:07 +08:00
groupClassesListAll().then(res => {
this.formConfig[0].selectOptions = res.data || []
})
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>