排班日历自动生成
This commit is contained in:
parent
b52d7118d2
commit
43a9575420
@ -62,22 +62,11 @@ export default {
|
||||
workdayList:[],//工作日
|
||||
selectedType:null,
|
||||
calendarDayList:[
|
||||
{
|
||||
theDay:'2022-06-04',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-13',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-14',
|
||||
shiftType: 'SHIFT_THREE',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
}
|
||||
],
|
||||
teamShiftQueryParams:{
|
||||
queryType:'TYPE',
|
||||
calendarType: null
|
||||
},
|
||||
queryParams: {
|
||||
theDay: null,
|
||||
holidayType: null,
|
||||
@ -90,6 +79,12 @@ export default {
|
||||
date:{
|
||||
handler(newVal,oldVal){
|
||||
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
|
||||
this.teamShiftQueryParams.date = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
|
||||
this.loading = true;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -119,11 +114,9 @@ export default {
|
||||
//点击班组类型
|
||||
onSelected(calType){
|
||||
this.loading = true;
|
||||
var param = {
|
||||
queryType: 'TYPE',
|
||||
calendarType: calType
|
||||
}
|
||||
listCalendars(param).then(response =>{
|
||||
this.teamShiftQueryParams.calendarType = calType;
|
||||
this.teamShiftQueryParams.date = this.date;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -71,22 +71,11 @@ export default {
|
||||
selectedType:null,
|
||||
form:{},
|
||||
calendarDayList:[
|
||||
{
|
||||
theDay:'2022-06-04',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-13',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-14',
|
||||
shiftType: 'SHIFT_THREE',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
}
|
||||
|
||||
],
|
||||
teamShiftQueryParams:{
|
||||
queryType:'USER',
|
||||
},
|
||||
queryParams: {
|
||||
theDay: null,
|
||||
holidayType: null,
|
||||
@ -99,6 +88,12 @@ export default {
|
||||
date:{
|
||||
handler(newVal,oldVal){
|
||||
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
|
||||
this.teamShiftQueryParams.date = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
|
||||
this.loading = true;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -133,11 +128,9 @@ export default {
|
||||
onUserSelected(row){
|
||||
this.form.nickName = row.nickName;
|
||||
this.loading = true;
|
||||
var param = {
|
||||
queryType: 'USER',
|
||||
userId: row.userId
|
||||
}
|
||||
listCalendars(param).then(response =>{
|
||||
this.teamShiftQueryParams.userId = row.userId;
|
||||
this.teamShiftQueryParams.date = this.date;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -64,22 +64,10 @@ export default {
|
||||
workdayList:[],//工作日
|
||||
selectedType:null,
|
||||
calendarDayList:[
|
||||
{
|
||||
theDay:'2022-06-04',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-13',
|
||||
shiftType: 'SHIFT_TWO',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
},
|
||||
{
|
||||
theDay:'2022-06-14',
|
||||
shiftType: 'SHIFT_THREE',
|
||||
teamShifts:[{teamName: '注塑1组',shiftName:'白班',orderNum: 1},{teamName: '注塑2组',shiftName:'中班',orderNum: 2},{teamName: '注塑3组',shiftName:'晚班',orderNum: 3}]
|
||||
}
|
||||
],
|
||||
teamShiftQueryParams: {
|
||||
queryType:'TEAM'
|
||||
},
|
||||
queryParams: {
|
||||
theDay: null,
|
||||
holidayType: null,
|
||||
@ -92,6 +80,12 @@ export default {
|
||||
date:{
|
||||
handler(newVal,oldVal){
|
||||
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
|
||||
this.teamShiftQueryParams.date = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
|
||||
this.loading = true;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -127,11 +121,9 @@ export default {
|
||||
//点击班组类型
|
||||
onSelected(teamId){
|
||||
this.loading = true;
|
||||
var param = {
|
||||
queryType: 'TEAM',
|
||||
teamId: teamId
|
||||
}
|
||||
listCalendars(param).then(response =>{
|
||||
this.teamShiftQueryParams.teamId = teamId;
|
||||
this.teamShiftQueryParams.date = this.date;
|
||||
listCalendars(this.teamShiftQueryParams).then(response =>{
|
||||
this.calendarDayList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -57,20 +57,9 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['cal:calplan:add']"
|
||||
v-hasPermi="['mes:cal:calplan:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['cal:calplan:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -79,7 +68,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['cal:calplan:remove']"
|
||||
v-hasPermi="['mes:cal:calplan:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -89,7 +78,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['cal:calplan:export']"
|
||||
v-hasPermi="['mes:cal:calplan:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -132,13 +121,18 @@
|
||||
<dict-tag :options="dict.type.mes_shift_method" :value="scope.row.shiftMethod"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:cal:calplan:edit']"
|
||||
>修改</el-button>
|
||||
@ -146,6 +140,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:cal:calplan:remove']"
|
||||
>删除</el-button>
|
||||
@ -162,7 +157,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改排班计划对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-dialog :title="title" v-loading="formLoading" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
@ -243,8 +238,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.shiftType !='SINGLE'" :span="6">
|
||||
<el-form-item label-width="80" prop="shiftCount">
|
||||
<el-col v-if="form.shiftMethod =='DAY' && form.shiftType !='SINGLE'" :span="6">
|
||||
<el-form-item label-width="20" prop="shiftCount">
|
||||
<el-input-number :min="1" controls-position="right" v-model="form.shiftCount" >
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
@ -267,8 +262,9 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE'">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.planId !=null">完成</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -282,7 +278,7 @@ import Team from "./team";
|
||||
import {genCode} from "@/api/system/autocode/rule"
|
||||
export default {
|
||||
name: "Calplan",
|
||||
dicts: ['mes_shift_method','mes_shift_type','mes_calendar_type'],
|
||||
dicts: ['mes_shift_method','mes_shift_type','mes_calendar_type','mes_order_status'],
|
||||
components: {Shift,Team},
|
||||
data() {
|
||||
return {
|
||||
@ -291,6 +287,7 @@ export default {
|
||||
optType: undefined,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
formLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
@ -371,6 +368,7 @@ export default {
|
||||
shiftType: 'SHIFT_TWO',
|
||||
shiftMethod: 'MONTH',
|
||||
shiftCount: 1,
|
||||
status: "PREPARE",
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
@ -430,6 +428,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.formLoading = true;
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.planId != null) {
|
||||
@ -437,6 +436,7 @@ export default {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.formLoading = false;
|
||||
});
|
||||
} else {
|
||||
addCalplan(this.form).then(response => {
|
||||
@ -458,6 +458,13 @@ export default {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleFinish(){
|
||||
let that = this;
|
||||
this.$modal.confirm('是否完成计划编制?【完成后将不能更改】').then(function(){
|
||||
that.form.status = 'CONFIRMED';
|
||||
that.submitForm();
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cal/calplan/export', {
|
||||
|
Loading…
Reference in New Issue
Block a user