This commit is contained in:
2024-02-01 14:24:12 +08:00
parent 21dc0412e3
commit 1bbd9b1e3a
14 changed files with 277 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
<template>
<div class="groupTeamScheduling">
<TopTab :roomNameDict='roomNameDict' @emitFun='toggleName'/>
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
@@ -87,13 +88,15 @@
<script>
import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
import { listEnabled } from "@/api/base/groupTeam";
import { listEnabledByRoom } from "@/api/base/groupTeam";
import moment from 'moment';
import TopTab from './components/topTab'
export default {
name: "GroupTeamScheduling",
data() {
return {
roomNameDict:null,
startDay: '',// 查询参数
year: '',// 2023
month: '',// 九月
@@ -108,7 +111,9 @@ export default {
autoScheduling: false // 只有在当前日期后的月份才生效
};
},
components:{ TopTab },
created() {
this.roomNameDict = this.getDictDatas('workshop')[0].value
this.startDay = new Date()
// 设置按钮是否置灰
this.settingBtn()
@@ -117,6 +122,22 @@ export default {
this.getList()
},
methods: {
// 切换车间
toggleName(val) {
this.roomNameDict = val
// 如果当前在设置,则取消设置
if (this.showSetting) {
this.showSetting = !this.showSetting
}
// 如果红框选中,清除红框选中
if (!this.jumpDisabled) {
this.clearChoose()
}
// 获取班组列表
this.getTeamList()
// 重新获取日历数据
this.getList()
},
// 切换月份
selectMonth() {
if (this.startDay) {
@@ -133,7 +154,10 @@ export default {
},
// 获取班组列表
getTeamList() {
listEnabled().then(res => {
console.log(this.roomNameDict)
listEnabledByRoom({
room: this.roomNameDict
}).then(res => {
this.teamList = res.data || []
})
},
@@ -143,7 +167,8 @@ export default {
let month = moment(this.startDay).format('M')
getPreset({
year: year,
month: month
month: month,
roomNameDict: this.roomNameDict
}).then(res => {
let obj = res.data || {}
if (obj) {
@@ -156,6 +181,7 @@ export default {
}
}
this.list = obj
this.settingBtnDis = false
}).catch(() => {
this.list = {}
this.settingBtnDis = true // 禁用设置按钮
@@ -246,7 +272,8 @@ export default {
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
autoSet({
year: this.year,
month: moment(this.startDay).month() + 1
month: moment(this.startDay).month() + 1,
roomNameDict: this.roomNameDict
}).then(res => {
this.list = res.data || {}
})
@@ -350,6 +377,8 @@ export default {
padding: 14px 10px 0 20px;
background-color: #fff;
border-radius: 8px;
height: calc(100vh - 255px);
overflow-y: auto;
.el-calendar__body {
padding: 10px 16px 16px 0;
}