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

176 lines
4.2 KiB
Vue
Raw Normal View History

2023-10-24 15:16:20 +08:00
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
2024-02-29 16:46:25 +08:00
<search-area @submit="buttonClick"/>
<!-- <search-bar
2023-10-24 15:16:20 +08:00
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
2024-02-29 16:46:25 +08:00
/> -->
2023-10-24 15:16:20 +08:00
<!-- 列表 -->
<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"
2023-11-22 16:58:32 +08:00
:width="80"
2023-10-24 15:16:20 +08:00
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>
2024-02-29 16:46:25 +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'
2024-02-01 14:24:12 +08:00
import { publicFormatter } from '@/utils/dict'
2024-02-29 16:46:25 +08:00
import SearchArea from './components/searchArea'
2023-10-24 15:16:20 +08:00
const tableProps = [
{
2024-02-01 14:24:12 +08:00
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100
2023-10-24 15:16:20 +08:00
},
2024-02-01 14:24:12 +08:00
// {
// prop: 'createTime',
// label: '排班创建时间',
// filter: parseTime,
// minWidth: 160
// },
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,
2023-11-22 16:58:32 +08:00
minWidth: 160
2023-10-24 15:16:20 +08:00
},
{
prop: 'endTime',
label: '下班时间',
2023-11-03 16:59:07 +08:00
filter: parseTime,
2023-11-22 16:58:32 +08:00
minWidth: 160
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')
? {
2023-11-22 16:58:32 +08:00
type: 'detail',
btnName: '详情'
2023-11-07 15:49:07 +08:00
}
: 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
}
},
2024-02-29 16:46:25 +08:00
components: { TeamProductionDetail, SearchArea },
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
})
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
},
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>