更新班组

This commit is contained in:
2025-10-24 11:42:24 +08:00
parent 67b6b88863
commit 31bafae4aa
17 changed files with 1865 additions and 257 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-13 15:07:24
* @LastEditors: zwq
* @LastEditTime: 2025-10-17 17:01:35
* @LastEditTime: 2025-10-24 09:19:17
* @Description:
-->
<template>
@@ -116,15 +116,7 @@
<el-input
v-model="dataForm.shiftSustainedNum"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
<el-select
style="width: 80px"
v-model="dataForm.shiftSustainedType"
slot="append">
<el-option label="日" :value="1"></el-option>
<el-option label="周" :value="2"></el-option>
<el-option label="月" :value="3"></el-option>
<el-option label="季" :value="4"></el-option>
</el-select>
<span slot="append"></span>
</el-input>
</el-form-item>
</el-col>
@@ -176,7 +168,10 @@
</base-table>
</div>
<div v-if="stepNum == 3">
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
<small-title
style="margin: 16px 0; font-size: 16px"
size="de"
:no-padding="true">
排班计划预览
<span style="font-size: 14px; color: #ff1c15">
系统将根据以下设置按班组轮班顺序依次循环每日班次生成正式排班计划请确认
@@ -263,6 +258,31 @@
</div>
</div>
</div>
<small-title
style="margin: 16px 0; font-size: 16px"
size="de"
:no-padding="true">
预览周期
<span>
<el-select
style="height: 20px"
v-model="period"
size="mini"
@change="setPeriod"
placeholder="请选择">
<el-option
v-for="item in periodArr"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</span>
</small-title>
<base-table
v-if="tableProps3.length > 0"
:table-props="tableProps3"
:table-data="tableData3"></base-table>
</div>
<base-dialog
:dialogTitle="'修改班次'"
@@ -306,11 +326,24 @@
<script>
import deptSelect from './../deptSelect.vue';
import SmallTitle from './SmallTitle';
import propfirstSpan from './propfirstSpan.vue';
import propSpan from './propSpan.vue';
import { parseTime } from '@/filter/code-filter';
import editClass from './edit-class.vue';
import addGroup from './add-group.vue';
import bindLine from './bind-line.vue';
import { getCode, createStepOne, returnStepOne } from '@/api/group/Schedule';
import {
getCode,
createStepOne,
returnStepOne,
createStepTwo,
returnStepTwo,
getPerView,
draftEditing,
cancelStepThree,
checkPlan,
createStepFour,
} from '@/api/group/Schedule';
const tableProps1 = [
{
@@ -318,18 +351,18 @@ const tableProps1 = [
label: '班次名称',
},
{
prop: 'startDay',
prop: 'startTime',
label: '开始时间',
// filter: (val) => {
// parseTime(val, '{H}:{mm}');
// },
filter: (val) => {
return val ? val.slice(0, -3) : '-';
},
},
{
prop: 'endDay',
prop: 'endTime',
label: '结束时间',
// filter: (val) => {
// parseTime(val, '{H}:{mm}');
// },
filter: (val) => {
return val ? val.slice(0, -3) : '-';
},
},
{
prop: 'remark',
@@ -356,7 +389,7 @@ const tableProps2 = [
width: 110,
},
{
prop: 'code1',
prop: 'lineName',
label: '产线及工段',
},
];
@@ -368,6 +401,8 @@ export default {
editClass,
addGroup,
bindLine,
propfirstSpan,
propSpan,
},
data() {
return {
@@ -383,6 +418,7 @@ export default {
},
],
stepNum: 1, // 当前第几步
shiftTypeEdit: undefined, //该值为编辑时获取的shiftType到第二步判断dataForm.shiftType是否改变同时改变班次信息
//第一步参数
dataForm: {
id: undefined,
@@ -527,41 +563,55 @@ export default {
class2: 'B',
},
],
period: 7, //预览周期
periodArr: [
{
value: 7,
label: '7天',
},
{
value: 14,
label: '14天',
},
{
value: 30,
label: '30天',
},
],
tableProps3: [],
tableData3: [],
};
},
methods: {
//子组件获取的部门id
setDeptId(val) {
this.dataForm.deptId = val;
},
//详情时传给子组件的部门id
setDataForm() {
this.$refs.deptSelect.setID(this.dataForm.deptId);
},
init() {
init(id) {
this.dataForm.id = id || undefined;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getCode().then((res) => {
this.dataForm.code = res.data;
});
if (this.dataForm.id) {
draftEditing(this.dataForm.id).then((res) => {
this.dataForm = res.data?.stepOne;
this.shiftTypeEdit = res.data?.stepOne.shiftType;
this.setDataForm();
this.tableData1 = res.data?.stepTwo.groupPlanClassesBaseVOList;
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
this.tableData2.forEach((item, index) => {
let lineName = '';
lineName = this.setLineName(item.bindLineTree, lineName);
this.$set(
this.tableData2[index],
'lineName',
lineName.slice(0, -1)
);
});
});
} else {
getCode().then((res) => {
this.dataForm.code = res.data;
});
}
});
},
handleClick1(val) {
this.addOrUpdateVisible1 = true;
this.$nextTick(() => {
this.$refs.editClassRef.init(val.data);
});
},
handleClick2(val) {
if (val.type === 'bind') {
this.addOrUpdateVisible3 = true;
this.$nextTick(() => {
this.$refs.bindLineRef.init(val.data.id);
});
} else if (val.type === 'delete') {
this.tableData2.splice(val.data._pageIndex - 1, 1);
}
},
//上一步
upSubmit() {
if (this.stepNum == 2) {
returnStepOne(this.dataForm.id).then((res) => {
@@ -571,8 +621,14 @@ export default {
this.setDataForm();
});
});
} else if (this.stepNum == 3) {
returnStepTwo(this.dataForm.id).then((res) => {
this.stepNum -= 1;
this.$emit('setSN', this.stepNum);
});
}
},
//下一步
nextSubmit() {
if (this.stepNum == 1) {
this.$refs['dataForm'].validate((valid) => {
@@ -585,93 +641,191 @@ export default {
return;
}
createStepOne(this.dataForm).then((res) => {
this.dataForm.id = res.data;
if (!this.dataForm.id) {
this.dataForm.id = res.data;
}
this.stepNum += 1;
this.$emit('setSN', this.stepNum);
this.setTWOclass(); // 第一步提交后,根据倒班方式设置第二部班次
if (
!this.dataForm.id ||
this.dataForm.shiftType !== this.shiftTypeEdit
) {
this.setTWOclass(); // (新增时或者编辑时倒班方式变了)第一步提交后,根据倒班方式设置第二部班次
}
});
});
return;
}
if (this.stepNum == 2) {
let data = {}
data.planId = this.dataForm.id
data.groupPlanClassesBaseVOList = [] //排班-班次信息list
this.tableData1.forEach((item,index)=>{
const obj = {
sort: index+1,
name : item.name,
remark: item.remark,
startTime: {
hour:item.startDay.split(':')[0],
minute:item.startDay.split(':')[1],
},
endTime: {
hour:item.endDay.split(':')[0],
minute:item.endDay.split(':')[1],
}
}
data.groupPlanClassesBaseVOList.push(obj)
})
data.groupPlanTeamBaseVOList = [] //排班-班组信息list
this.tableData2.forEach(item=>{
const obj = {
teamId:item.id,
bindData: ''
}
data.groupPlanTeamBaseVOList.push(obj)
})
this.stepNum += 1;
this.$emit('setSN', this.stepNum);
if (!this.tableData2 || this.tableData2.length == 0) {
this.$message('班组不能为空');
return;
}
let isbindLine = false;
this.tableData2.forEach((item) => {
if (!item.bindLineTree || item.bindLineTree.length == 0) {
isbindLine = true;
}
});
if (isbindLine) {
this.$message('生产班组必须绑定产线或工段');
return;
}
const ids = this.tableData2.map((item) => item.id);
const uniqueIds = [...new Set(ids)];
if (ids.length !== uniqueIds.length) {
this.$message('存在重复的班组,请检查!');
return;
}
if (this.dataForm.shiftType == 1 && this.tableData2.length > 1) {
this.$message('白班,班组数量仅支持 1个 班组');
return;
} else if (this.dataForm.shiftType == 2 && this.tableData2.length < 2) {
this.$message('两班倒,班组数量至少 2个 班组');
return;
} else if (this.dataForm.shiftType == 3 && this.tableData2.length < 3) {
this.$message('三班倒,班组数量至少 3个 班组');
return;
}
let data = {};
data.planId = this.dataForm.id;
data.groupPlanClassesBaseVOList = []; //排班-班次信息list
this.tableData1.forEach((item, index) => {
const obj = {
sort: index + 1,
name: item.name,
remark: item.remark,
startTime: item.startTime,
endTime: item.endTime,
daySpan: item.daySpan,
};
data.groupPlanClassesBaseVOList.push(obj);
});
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
this.tableData2.forEach((item) => {
const obj = {
teamId: item.id,
name: item.name,
leaderName: item.leaderName,
leaderPhone:item.leaderPhone,
bindData: JSON.stringify(item.bindLineTree),
};
data.groupPlanTeamBaseVOList.push(obj);
});
createStepTwo(data).then((res) => {
this.stepNum += 1;
this.$emit('setSN', this.stepNum);
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
});
return;
}
if (this.stepNum == 3) {
this.stepNum = 1;
this.$emit('setSN', this.stepNum);
let data = { planId: this.dataForm.id };
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
this.tableData2.forEach((item) => {
const obj = {
teamId: item.id,
name: item.name,
bindData: JSON.stringify(item.bindLineTree),
};
data.groupPlanTeamBaseVOList.push(obj);
});
checkPlan(data).then((RES) => {
createStepFour(this.dataForm.id).then((res) => {
this.$modal.msgSuccess('创建计划成功');
this.stepNum = 1;
this.$emit('setSN', this.stepNum);
this.$emit('refreshDataList');
});
});
return;
}
},
//第一步
//子组件获取的部门id
setDeptId(val) {
this.dataForm.deptId = val;
},
//详情时传给子组件的部门id
setDataForm() {
this.$refs.deptSelect.setID(this.dataForm.deptId);
},
//第二步
//设置第二部班次
setTWOclass() {
this.tableData1 = [];
if (this.dataForm.shiftType == 1) {
const obj = {
name: '长白班',
startDay: '8:00',
endDay: '17:00',
startTime: '08:00:00',
endTime: '17:00:00',
daySpan: 0, //是否跨天
code: 1, //排版日历页面,根据这个字段显示颜色
};
this.tableData1.push(obj);
} else if (this.dataForm.shiftType == 2) {
const obj1 = {
name: '白班',
startDay: '8:00',
endDay: '20:00',
startTime: '08:00:00',
endTime: '20:00:00',
daySpan: 0,
code: 1,
};
const obj2 = {
name: '夜班',
startDay: '20:00',
endDay: '8:00',
startTime: '20:00:00',
endTime: '08:00:00',
daySpan: 1,
code: 3,
};
this.tableData1.push(obj1, obj2);
} else if (this.dataForm.shiftType == 3) {
const obj1 = {
name: '早班',
startDay: '8:00',
endDay: '16:00',
startTime: '08:00:00',
endTime: '16:00:00',
daySpan: 0,
code: 1,
};
const obj2 = {
name: '中班',
startDay: '16:00',
endDay: '00:00',
startTime: '16:00:00',
endTime: '00:00:00',
daySpan: 1,
code: 2,
};
const obj3 = {
name: '夜班',
startDay: '00:00',
endDay: '8:00',
startTime: '00:00:00',
endTime: '08:00:00',
daySpan: 0,
code: 3,
};
this.tableData1.push(obj1, obj2, obj3);
}
},
//编辑班次
handleClick1(val) {
this.addOrUpdateVisible1 = true;
this.$nextTick(() => {
this.$refs.editClassRef.init(val.data);
});
},
//班组操作
handleClick2(val) {
if (val.type === 'bind') {
this.addOrUpdateVisible3 = true;
this.$nextTick(() => {
this.$refs.bindLineRef.init(val.data);
});
} else if (val.type === 'delete') {
this.tableData2.splice(val.data._pageIndex - 1, 1);
}
},
// 新增班组
addNewGroup() {
this.addOrUpdateVisible2 = true;
@@ -705,10 +859,93 @@ export default {
this.tableData2.push(...val);
this.cancel2();
},
refreshTableData3(val) {
console.log(val);
refreshTableData3(index, val) {
this.tableData2[index].bindLineTree = val;
let lineName = '';
lineName = this.setLineName(val, lineName);
if (lineName) {
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
}
this.cancel3();
},
//提取绑定的产线工段名展示出来
setLineName(val, lineName) {
val.forEach((item) => {
lineName += item.name + '';
if (item.children && item.children.length > 0) {
const childName = this.setLineName(item.children, lineName);
lineName = childName;
}
});
return lineName;
},
//第三步
// 进来加载预览排班
getThreeGroup(day) {
const data = {
id: this.dataForm.id,
count: day,
};
this.tableProps3 = [];
this.tableData3 = [];
getPerView(data).then((res) => {
this.setThreeData(res.data);
});
},
setPeriod(val) {
this.getThreeGroup(val);
},
setThreeData(data) {
//表头第一个为班次名称
const propfirst = {
prop: 'name',
label: '',
align: 'center',
fixed: true,
subcomponent: propfirstSpan,
};
this.tableProps3.push(propfirst);
data.forEach((item, index) => {
//设置所有日期为表头
const obj = {
prop: 'daydata' + index,
label: item.day,
work: item.work,
subcomponent: propSpan,
};
this.tableProps3.push(obj);
item.det.forEach((sItem, sIndex) => {
if (index === 0) {
let sObj = {
name: sItem.classesName + '/' + sItem.time,
sort: sItem.sort,
};
sObj['daydata' + index] = item.work
? sItem.teamName
: item.holidayName;
this.tableData3.push(sObj);
} else {
this.$set(
this.tableData3[sIndex],
'daydata' + index,
item.work ? sItem.teamName : item.holidayName
);
this.$set(this.tableData3[sIndex], 'sort', sItem.sort);
}
});
});
},
cancelStep() {
if (this.stepNum > 1) {
cancelStepThree(this.dataForm.id).then((res) => {
this.$message('已取消计划');
this.$emit('refreshDataList');
});
} else {
this.$emit('refreshDataList');
}
},
},
};
</script>

View File

@@ -31,7 +31,6 @@ export default {
components: { treeTransfer },
data() {
return {
groupId: undefined,
title: ['待选', '已选'],
mode: 'transfer',
fromData: [], //左边内容
@@ -39,10 +38,10 @@ export default {
};
},
methods: {
init(id) {
init(val) {
this._pageIndex = val._pageIndex-1;
this.fromData = [];
this.toData = [];
this.groupId = id;
getGroupPlanTree().then((res) => {
this.fromData = res.data;
this.fromData.forEach((item) => {
@@ -62,7 +61,7 @@ export default {
},
// 表单提交
dataFormSubmit() {
this.$emit('refreshTableData',this.toData);
this.$emit('refreshTableData', this._pageIndex,this.toData);
},
},
};

View File

@@ -0,0 +1,187 @@
<!--
* @Author: zwq
* @Date: 2025-10-21 14:27:23
* @LastEditors: zwq
* @LastEditTime: 2025-10-21 15:02:27
* @Description:
-->
<template>
<div>
<div class="info-div">
<div>
<span class="title">计划编号:</span>
{{ infoData.code }}
</div>
<div>
<span class="title">计划状态:</span>
{{ ['', '草稿', '已确认', '已作废'][infoData.status] }}
</div>
<div>
<span class="title">计划名称:</span>
{{ infoData.name }}
</div>
<div>
<span class="title">部门:</span>
{{ infoData.deptName }}
</div>
<div>
<span class="title">开始时间:</span>
{{ parseTime(infoData.startDay) }}
</div>
<div>
<span class="title">结束时间:</span>
{{ parseTime(infoData.endDay) }}
</div>
<div>
<span class="title">周末休假方式:</span>
{{ ['', '双休', '周六休', '周日休', '不休'][infoData.weekType] }}
</div>
<div>
<span class="title">倒班方式:</span>
{{ ['', '长白班', '两班倒', '三班倒'][infoData.shiftType] }}
</div>
<div>
<span class="title">同班次连排:</span>
{{ infoData.shiftSustainedNum }}
</div>
<div>
<span class="title">创建人:</span>
{{ infoData.creator }}
</div>
<div>
<span class="title">创建时间:</span>
{{ parseTime(infoData.createTime) }}
</div>
<div v-if="infoData.status == 3">
<span class="title">作废时间:</span>
{{ parseTime(infoData.disableTime) }}
</div>
<div>
<span class="title">备注:</span>
{{ infoData.remark }}
</div>
</div>
<div>
<el-tabs v-model="activeName" stretch>
<el-tab-pane label="班次" name="first"></el-tab-pane>
<el-tab-pane label="班组" name="second"></el-tab-pane>
</el-tabs>
<base-table
v-if="activeName == 'first'"
:table-props="tableProps1"
:page="1"
:limit="10"
:table-data="tableData1"></base-table>
<base-table
v-else
:table-props="tableProps2"
:page="1"
:limit="10"
:table-data="tableData2"></base-table>
</div>
</div>
</template>
<script>
import { parseTime } from '@/filter/code-filter';
import { getPlan } from '@/api/group/Schedule';
const tableProps1 = [
{
prop: 'name',
label: '班次名称',
},
{
prop: 'startTime',
label: '开始时间',
filter: (val) => {
return val ? val.slice(0, -3) : '-';
},
},
{
prop: 'endTime',
label: '结束时间',
filter: (val) => {
return val ? val.slice(0, -3) : '-';
},
},
{
prop: 'remark',
label: '备注',
},
];
const tableProps2 = [
{
prop: 'code',
label: '班组编号',
width: 140,
},
{
prop: 'name',
label: '班组名称',
},
{
prop: 'isProduction',
label: '是否生产班组',
filter: (val) => {
return val ? '是' : '否';
},
width: 110,
},
{
prop: 'lineName',
label: '产线及工段',
},
];
export default {
data() {
return {
infoData: {},
activeName: 'first',
tableProps1,
tableData1: [],
tableProps2,
tableData2: [],
};
},
methods: {
init(id) {
this.infoData = {};
getPlan(id).then((res) => {
this.infoData = res.data || {};
console.log(res);
this.tableData1 = res.data?.groupPlanClassesBaseVOList;
this.tableData2 = res.data?.groupPlanTeamBaseVOList;
this.tableData2.forEach((item, index) => {
let lineName = '';
lineName = this.setLineName(item.bindLineTree, lineName);
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
});
});
},
//提取绑定的产线工段名展示出来
setLineName(val, lineName) {
val.forEach((item) => {
lineName += item.name + '';
if (item.children && item.children.length > 0) {
const childName = this.setLineName(item.children, lineName);
lineName = childName;
}
});
return lineName;
},
},
};
</script>
<style scoped>
.info-div {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 10px;
}
.title {
font-weight: bold;
}
</style>

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-10-15 16:31:11
* @LastEditTime: 2025-10-20 10:23:52
* @Description:
-->
<template>
@@ -32,22 +32,22 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="startDay">
<el-form-item label="开始时间" prop="startTime">
<el-time-picker
style="width: 100%"
format="H:mm"
value-format="H:mm"
v-model="dataForm.startDay"
value-format="HH:mm:ss"
v-model="dataForm.startTime"
placeholder="选择日期时间"></el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="endDay">
<el-form-item label="结束时间" prop="endTime">
<el-time-picker
style="width: 100%"
format="H:mm"
value-format="H:mm"
v-model="dataForm.endDay"
value-format="HH:mm:ss"
v-model="dataForm.endTime"
placeholder="选择日期时间"></el-time-picker>
</el-form-item>
</el-col>
@@ -72,8 +72,8 @@ export default {
id: undefined,
index: undefined,
name: undefined,
startDay: undefined,
endDay: undefined,
startTime: undefined,
endTime: undefined,
remark: undefined,
},
_pageIndex: 1,
@@ -82,10 +82,10 @@ export default {
name: [
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
],
startDay: [
startTime: [
{ required: true, message: '开始时间不能为空', trigger: 'change' },
],
endDay: [
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'change' },
],
},
@@ -96,8 +96,8 @@ export default {
this._pageIndex = val._pageIndex-1;
this.dataForm.index = val._pageIndex || 1;
this.dataForm.name = val.name || undefined;
this.dataForm.startDay = val.startDay || undefined;
this.dataForm.endDay = val.endDay || undefined;
this.dataForm.startTime = val.startTime || undefined;
this.dataForm.endTime = val.endTime || undefined;
this.dataForm.remark = val.remark || undefined;
},
// 表单提交

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-11 14:27:37
* @LastEditors: zwq
* @LastEditTime: 2025-10-15 16:42:28
* @LastEditTime: 2025-10-23 16:31:41
* @Description:
-->
<template>
@@ -95,7 +95,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
:width="270"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@@ -112,7 +112,7 @@
@confirm="handleConfirm"
:before-close="handleCancel"
:destroy-on-close="true"
append-to-body
append-to-body
width="60%">
<add-or-update
ref="addOrUpdate"
@@ -141,7 +141,7 @@
class="btnTextStyle"
size="small"
plain
@click="handleConfirm">
@click="successSubmit">
保存草稿
</el-button>
<el-button
@@ -156,6 +156,30 @@
</slot>
</template>
</base-dialog>
<base-dialog
:dialogTitle="'排班计划详情'"
:dialogVisible="detailVisible"
@cancel="detailCancel"
:before-close="detailCancel"
:destroy-on-close="true"
append-to-body
width="50%">
<detail ref="detailRef"></detail>
<template #footer>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button
size="small"
class="btnTextStyle"
@click="detailCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</template>
</base-dialog>
</div>
</template>
@@ -165,8 +189,15 @@ import deptSelect from './../deptSelect.vue';
import basicPage from '@/mixins/basic-page';
import subSpan from './subSpan.vue';
import subStatus from './subStatus.vue';
import detail from './detail.vue';
import { parseTime } from '@/filter/code-filter';
import { getGroupPlanPage, deleteGroupPlan } from '@/api/group/Schedule';
import {
getGroupPlanPage,
deleteGroupPlan,
copyPlan,
disablePlan,
updateScheduleLater,
} from '@/api/group/Schedule';
const tableProps = [
{
@@ -206,7 +237,7 @@ const tableProps = [
subcomponent: subSpan,
},
{
prop: 'deptId',
prop: 'deptName',
label: '部门',
},
{
@@ -337,11 +368,13 @@ export default {
status: '',
},
stepNum: 1, // 新增编辑时当前第几步
detailVisible: false,
};
},
components: {
AddOrUpdate,
deptSelect,
detail
},
created() {},
methods: {
@@ -396,10 +429,15 @@ export default {
setStepNum(val) {
this.stepNum = val;
},
// dialog取消
handleCancel() {
successSubmit() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
this.stepNum = 1;
this.getDataList();
},
// dialog取消
handleCancel() {
this.$refs.addOrUpdate.cancelStep();
},
handleConfirm(val) {
if (val == 'up') {
@@ -408,6 +446,41 @@ export default {
this.$refs.addOrUpdate.nextSubmit();
}
},
//tableBtn点击
handleClick(val) {
if (val.type === 'edit') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === 'delete') {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex);
} else if (val.type === 'detail') {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.detailRef.init(val.data.id);
});
} else if (val.type === 'cancel') {
disablePlan(val.data.id).then((res) => {
this.$modal.msgSuccess('作废成功');
this.getDataList()
});
} else if (val.type === 'sync') {
updateScheduleLater({ planId: val.data.id }).then((res) => {
this.$modal.msgSuccess('同步节假日成功');
this.getDataList()
});
} else if (val.type === 'copy') {
copyPlan(val.data.id).then((res) => {
this.$modal.msgSuccess('复制成功');
this.getDataList()
});
}
},
detailCancel() {
this.detailVisible = false;
},
},
};
</script>
@@ -449,21 +522,21 @@ export default {
margin: 4px 0;
}
body .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
body .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
body .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@@ -0,0 +1,36 @@
<!--
* @Author: zwq
* @Date: 2025-10-13 16:18:41
* @LastEditors: zwq
* @LastEditTime: 2025-10-21 13:54:52
* @Description:
-->
<template>
<span>
<el-tag
v-if="injectData.work"
size="small"
:type="['', 'success', 'warning'][injectData.sort]">
{{ injectData[injectData.prop] }}
</el-tag>
<el-tag v-else effect="dark" size="small" type="info">
{{ injectData[injectData.prop] }}
</el-tag>
</span>
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {};
},
created() {},
methods: {},
};
</script>

View File

@@ -0,0 +1,33 @@
<!--
* @Author: zwq
* @Date: 2025-10-13 16:18:41
* @LastEditors: zwq
* @LastEditTime: 2025-10-20 10:13:26
* @Description:
-->
<template>
<div>
<div>
{{ injectData.name.split('/')[0] }}
</div>
<div>
{{ injectData.name.split('/')[1] }}
</div>
</div>
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {};
},
created() {},
methods: {},
};
</script>

View File

@@ -1,9 +1,16 @@
<!--
* @Author: zwq
* @Date: 2025-10-13 16:18:41
* @LastEditors: zwq
* @LastEditTime: 2025-10-20 10:13:26
* @Description:
-->
<template>
<span>
{{
injectData.shiftSustainedNum +
(injectDatashiftSustainedType
? ['', '日', '周', '月', '季'][injectDatashiftSustainedType]
(injectData.shiftSustainedType
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
: '')
}}
</span>