更新班组 #447
@@ -6,7 +6,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"local": "vue-cli-service serve --mode local",
|
"local": "vue-cli-service serve --mode local",
|
||||||
"dev": "vue-cli-service serve --mode dev",
|
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
|
||||||
"front": "vue-cli-service serve --mode front",
|
"front": "vue-cli-service serve --mode front",
|
||||||
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
||||||
"build:stage": "vue-cli-service build --mode stage",
|
"build:stage": "vue-cli-service build --mode stage",
|
||||||
@@ -77,6 +77,7 @@
|
|||||||
"vue": "2.7.14",
|
"vue": "2.7.14",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-cropper": "0.5.8",
|
"vue-cropper": "0.5.8",
|
||||||
|
"vue-jlunar-datepicker": "^2.3.2",
|
||||||
"vue-meta": "^2.4.0",
|
"vue-meta": "^2.4.0",
|
||||||
"vue-plugin-hiprint": "0.0.54-fix",
|
"vue-plugin-hiprint": "0.0.54-fix",
|
||||||
"vue-quill-editor": "^3.0.6",
|
"vue-quill-editor": "^3.0.6",
|
||||||
|
|||||||
@@ -141,3 +141,13 @@ export function getPerView(data) {
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出 Excel
|
||||||
|
export function exportExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,3 +90,29 @@ export function getEnableData() {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 解除继承节假日
|
||||||
|
export function disExtends(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/disExtends',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 恢复继承节假日
|
||||||
|
export function reExtends(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/reExtends',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得部门节假日继承设置信息设置
|
||||||
|
export function getSet(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday-dept-set/getSet',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-23 13:43:55
|
* @Date: 2025-10-23 13:43:55
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-23 16:50:43
|
* @LastEditTime: 2025-11-05 13:50:39
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container" style="padding-top:0">
|
||||||
<div v-for="item in groupClassArr" :key="item.planId">
|
<div v-for="item in groupClassArr" :key="item.planId">
|
||||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
{{item.planName}}
|
{{deptName + ' - ' +item.planName}}
|
||||||
</small-title>
|
</small-title>
|
||||||
<base-table
|
<base-table
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
@@ -55,12 +55,14 @@ export default {
|
|||||||
tableProps,
|
tableProps,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
groupClassArr: [],
|
groupClassArr: [],
|
||||||
|
deptName: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
init(det) {
|
init(det,deptName) {
|
||||||
this.tableData = det;
|
this.tableData = det;
|
||||||
|
this.deptName = deptName
|
||||||
//返回计划名和id
|
//返回计划名和id
|
||||||
const arr = det.map((item) => {
|
const arr = det.map((item) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-23 13:43:55
|
* @Date: 2025-10-23 13:43:55
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-24 11:14:55
|
* @LastEditTime: 2025-11-05 13:48:48
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -167,7 +167,9 @@
|
|||||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
?.det,
|
?.det,
|
||||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
?.date
|
?.date,
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.deptName
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:title="
|
:title="
|
||||||
@@ -441,11 +443,11 @@ export default {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
holidayLog(det, date) {
|
holidayLog(det, date,deptName) {
|
||||||
this.dialogTitle = this.showDeptName + '-' + date + '-排班详情';
|
this.dialogTitle = this.showDeptName + '-' + date + '-排班详情';
|
||||||
this.logVisible = true;
|
this.logVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.holidayLogRef.init(det);
|
this.$refs.holidayLogRef.init(det,deptName);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancelLog() {
|
cancelLog() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-11 14:27:37
|
* @Date: 2025-10-11 14:27:37
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-29 17:12:04
|
* @LastEditTime: 2025-11-04 15:16:48
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listByDeptId } from '@/api/group/Schedule';
|
import { getGroupPage } from '@/api/group/groupSetting';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ const tableProps = [
|
|||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'deptId',
|
prop: 'deptName',
|
||||||
label: '所属部门',
|
label: '所属部门',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: listByDeptId,
|
getDataListURL: getGroupPage,
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -86,16 +86,16 @@ export default {
|
|||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
deptId: undefined,
|
||||||
},
|
},
|
||||||
selectedList: [],
|
selectedList: [],
|
||||||
selectedArr: [], //已选的班组,从父组件传过来的
|
selectedArr: [], //已选的班组,从父组件传过来的
|
||||||
deptId: undefined,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
init(id, tableData) {
|
init(id, tableData) {
|
||||||
this.deptId = id;
|
this.formInline.deptId = id;
|
||||||
this.selectedArr = tableData || [];
|
this.selectedArr = tableData || [];
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -103,8 +103,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.urlOptions.getDataListURL(this.deptId).then((response) => {
|
this.urlOptions.getDataListURL(this.formInline).then((response) => {
|
||||||
this.tableData = response.data;
|
this.tableData = response.data.list;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.selectedArr.length > 0) {
|
if (this.selectedArr.length > 0) {
|
||||||
this.setSelectedRows();
|
this.setSelectedRows();
|
||||||
@@ -149,22 +149,19 @@ export default {
|
|||||||
selectChange(val) {
|
selectChange(val) {
|
||||||
this.selectedList = val;
|
this.selectedList = val;
|
||||||
},
|
},
|
||||||
// 判断两个数组是否有重复的 id
|
// 判断两个数组是否有重复的 id,去重
|
||||||
hasDuplicateIds(arr1, arr2) {
|
hasDuplicateIds(arr1, arr2) {
|
||||||
const idSet = new Set(arr1.map((item) => item.id));
|
return arr2.filter(
|
||||||
return arr2.some((item) => idSet.has(item.id));
|
(item2) => !arr1.some((item1) => item1.id === item2.id)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
if (this.selectedList && this.selectedList.length > 0) {
|
if (this.selectedList && this.selectedList.length > 0) {
|
||||||
const haveData = this.hasDuplicateIds(
|
this.selectedList = this.hasDuplicateIds(
|
||||||
this.selectedArr,
|
this.selectedArr,
|
||||||
this.selectedList
|
this.selectedList
|
||||||
);
|
);
|
||||||
if (haveData) {
|
|
||||||
this.$message('请不要重复添加数组');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$emit('refreshTableData', this.selectedList);
|
this.$emit('refreshTableData', this.selectedList);
|
||||||
} else if (this.selectedArr.length > 0) {
|
} else if (this.selectedArr.length > 0) {
|
||||||
this.$message('请不要重复添加数组');
|
this.$message('请不要重复添加数组');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-13 15:07:24
|
* @Date: 2025-10-13 15:07:24
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-29 15:28:52
|
* @LastEditTime: 2025-11-04 16:07:45
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -54,10 +54,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="部门">
|
<el-form-item label="部门" prop="deptId">
|
||||||
<dept-select
|
<dept-select
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
ref="deptSelect"
|
ref="deptSelect"
|
||||||
|
v-model="dataForm.deptId"
|
||||||
@DeptId="setDeptId"></dept-select>
|
@DeptId="setDeptId"></dept-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -111,7 +112,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6" v-if="dataForm.shiftType>1">
|
<el-col :span="6" v-if="dataForm.shiftType > 1">
|
||||||
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.shiftSustainedNum"
|
v-model="dataForm.shiftSustainedNum"
|
||||||
@@ -150,6 +151,12 @@
|
|||||||
</base-table>
|
</base-table>
|
||||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
班组
|
班组
|
||||||
|
<el-tag type="warning" style="color: black">
|
||||||
|
<i class="el-icon-warning" style="color: #ffbd02"></i>
|
||||||
|
排班从计划开始时间对应的第一个班次开始,按
|
||||||
|
<span style="color: red">班组列表顺序</span>
|
||||||
|
依次循环执行
|
||||||
|
</el-tag>
|
||||||
</small-title>
|
</small-title>
|
||||||
<base-table
|
<base-table
|
||||||
:table-props="tableProps2"
|
:table-props="tableProps2"
|
||||||
@@ -157,6 +164,7 @@
|
|||||||
:limit="10"
|
:limit="10"
|
||||||
:table-data="tableData2"
|
:table-data="tableData2"
|
||||||
:add-button-show="'新增'"
|
:add-button-show="'新增'"
|
||||||
|
@emitFun="handleSort"
|
||||||
@emitButtonClick="addNewGroup">
|
@emitButtonClick="addNewGroup">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn2.length"
|
v-if="tableBtn2.length"
|
||||||
@@ -174,8 +182,7 @@
|
|||||||
:no-padding="true">
|
:no-padding="true">
|
||||||
排班计划预览
|
排班计划预览
|
||||||
<span style="font-size: 14px; color: #ff1c15">
|
<span style="font-size: 14px; color: #ff1c15">
|
||||||
系统将根据以下设置,按班组轮班顺序依次循环每日班次,生成正式排班计划,请确认。
|
系统将根据
|
||||||
|
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
title="比如三班两倒,同班次连排2天,不休周末排班如下"
|
title="比如三班两倒,同班次连排2天,不休周末排班如下"
|
||||||
@@ -192,9 +199,10 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<i
|
<i
|
||||||
slot="reference"
|
slot="reference"
|
||||||
class="el-icon-warning-outline"
|
class="el-icon-chat-dot-square"
|
||||||
style="color: #ff1c15"></i>
|
style="color: #409eff; font-size: 18px"></i>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
设置,按班组轮班顺序依次循环每日班次,生成正式排班计划,请确认。
|
||||||
</span>
|
</span>
|
||||||
</small-title>
|
</small-title>
|
||||||
<el-tag>
|
<el-tag>
|
||||||
@@ -227,7 +235,7 @@
|
|||||||
<div style="color: rgba(0, 0, 0, 0.6)">同班次连排</div>
|
<div style="color: rgba(0, 0, 0, 0.6)">同班次连排</div>
|
||||||
<div style="color: #000000">
|
<div style="color: #000000">
|
||||||
{{
|
{{
|
||||||
dataForm.shiftSustainedNum +
|
(dataForm.shiftSustainedNum ? dataForm.shiftSustainedNum : '') +
|
||||||
['日', '周', '月', '季'][dataForm.shiftSustainedType - 1]
|
['日', '周', '月', '季'][dataForm.shiftSustainedType - 1]
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
@@ -335,6 +343,7 @@ import { parseTime } from '@/filter/code-filter';
|
|||||||
import editClass from './edit-class.vue';
|
import editClass from './edit-class.vue';
|
||||||
import addGroup from './add-group.vue';
|
import addGroup from './add-group.vue';
|
||||||
import bindLine from './bind-line.vue';
|
import bindLine from './bind-line.vue';
|
||||||
|
import sortSet from './sortSet.vue';
|
||||||
import {
|
import {
|
||||||
getCode,
|
getCode,
|
||||||
createStepOne,
|
createStepOne,
|
||||||
@@ -374,10 +383,17 @@ const tableProps1 = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'shunxu',
|
||||||
|
label: '顺序',
|
||||||
|
width: 70,
|
||||||
|
subcomponent: sortSet,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '班组编号',
|
label: '班组编号',
|
||||||
width: 140,
|
width: 140,
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
@@ -476,6 +492,7 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: '计划名称不能为空', trigger: 'blur' },
|
{ required: true, message: '计划名称不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
|
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
|
||||||
startDay: [
|
startDay: [
|
||||||
{ required: true, message: '开始时间不能为空', trigger: 'change' },
|
{ required: true, message: '开始时间不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
@@ -610,12 +627,10 @@ export default {
|
|||||||
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
|
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
|
||||||
this.tableData2.forEach((item, index) => {
|
this.tableData2.forEach((item, index) => {
|
||||||
let lineName = '';
|
let lineName = '';
|
||||||
lineName = this.setLineName(item.bindLineTree, lineName);
|
if (item.isProduction) {
|
||||||
this.$set(
|
lineName = this.setLineName(item.bindLineTree);
|
||||||
this.tableData2[index],
|
}
|
||||||
'lineName',
|
this.$set(this.tableData2[index], 'lineName', lineName);
|
||||||
lineName.slice(0, -1)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -654,9 +669,12 @@ export default {
|
|||||||
this.$message('部门不能为空');
|
this.$message('部门不能为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const compareDate = this.compareDates(this.dataForm.startDay,this.dataForm.endDay)
|
const compareDate = this.compareDates(
|
||||||
|
this.dataForm.startDay,
|
||||||
|
this.dataForm.endDay
|
||||||
|
);
|
||||||
|
|
||||||
if (compareDate > 0 ) {
|
if (compareDate > 0) {
|
||||||
this.$message('开始时间不能大于结束时间');
|
this.$message('开始时间不能大于结束时间');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -684,7 +702,10 @@ export default {
|
|||||||
|
|
||||||
let isbindLine = false;
|
let isbindLine = false;
|
||||||
this.tableData2.forEach((item) => {
|
this.tableData2.forEach((item) => {
|
||||||
if (!item.bindLineTree || item.bindLineTree.length == 0) {
|
if (
|
||||||
|
item.isProduction &&
|
||||||
|
(!item.bindLineTree || item.bindLineTree.length == 0)
|
||||||
|
) {
|
||||||
isbindLine = true;
|
isbindLine = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -730,8 +751,8 @@ export default {
|
|||||||
const obj = {
|
const obj = {
|
||||||
teamId: item.id,
|
teamId: item.id,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
leaderName: item.leaderName,
|
leaderName: item.leaderName,
|
||||||
leaderPhone:item.leaderPhone,
|
leaderPhone: item.leaderPhone,
|
||||||
bindData: JSON.stringify(item.bindLineTree),
|
bindData: JSON.stringify(item.bindLineTree),
|
||||||
};
|
};
|
||||||
data.groupPlanTeamBaseVOList.push(obj);
|
data.groupPlanTeamBaseVOList.push(obj);
|
||||||
@@ -774,7 +795,7 @@ export default {
|
|||||||
setDataForm() {
|
setDataForm() {
|
||||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||||
},
|
},
|
||||||
//比较时间,开始时间在结束时间前
|
//比较时间,开始时间在结束时间前
|
||||||
compareDates(date1, date2) {
|
compareDates(date1, date2) {
|
||||||
const d1 = date1;
|
const d1 = date1;
|
||||||
const d2 = date2;
|
const d2 = date2;
|
||||||
@@ -793,50 +814,56 @@ export default {
|
|||||||
this.tableData1 = [];
|
this.tableData1 = [];
|
||||||
if (this.dataForm.shiftType == 1) {
|
if (this.dataForm.shiftType == 1) {
|
||||||
const obj = {
|
const obj = {
|
||||||
|
sort: 1,
|
||||||
name: '长白班',
|
name: '长白班',
|
||||||
startTime: '08:00:00',
|
startTime: '08:00:00',
|
||||||
endTime: '17:00:00',
|
endTime: '17:00:00',
|
||||||
daySpan: 0, //是否跨天
|
daySpan: 0, //是否跨天
|
||||||
code: 1, //排版日历页面,根据这个字段显示颜色
|
code: 1, //排版日历页面,根据这个字段显示颜色
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj);
|
this.tableData1.push(obj);
|
||||||
} else if (this.dataForm.shiftType == 2) {
|
} else if (this.dataForm.shiftType == 2) {
|
||||||
const obj1 = {
|
const obj1 = {
|
||||||
|
sort: 1,
|
||||||
name: '白班',
|
name: '白班',
|
||||||
startTime: '08:00:00',
|
startTime: '08:00:00',
|
||||||
endTime: '20:00:00',
|
endTime: '20:00:00',
|
||||||
daySpan: 0,
|
daySpan: 0,
|
||||||
code: 1,
|
code: 1,
|
||||||
};
|
};
|
||||||
const obj2 = {
|
const obj2 = {
|
||||||
|
sort: 2,
|
||||||
name: '夜班',
|
name: '夜班',
|
||||||
startTime: '20:00:00',
|
startTime: '20:00:00',
|
||||||
endTime: '08:00:00',
|
endTime: '08:00:00',
|
||||||
daySpan: 1,
|
daySpan: 1,
|
||||||
code: 3,
|
code: 3,
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj1, obj2);
|
this.tableData1.push(obj1, obj2);
|
||||||
} else if (this.dataForm.shiftType == 3) {
|
} else if (this.dataForm.shiftType == 3) {
|
||||||
const obj1 = {
|
const obj1 = {
|
||||||
|
sort: 1,
|
||||||
name: '早班',
|
name: '早班',
|
||||||
startTime: '08:00:00',
|
startTime: '08:00:00',
|
||||||
endTime: '16:00:00',
|
endTime: '16:00:00',
|
||||||
daySpan: 0,
|
daySpan: 0,
|
||||||
code: 1,
|
code: 1,
|
||||||
};
|
};
|
||||||
const obj2 = {
|
const obj2 = {
|
||||||
|
sort: 2,
|
||||||
name: '中班',
|
name: '中班',
|
||||||
startTime: '16:00:00',
|
startTime: '16:00:00',
|
||||||
endTime: '00:00:00',
|
endTime: '00:00:00',
|
||||||
daySpan: 1,
|
daySpan: 1,
|
||||||
code: 2,
|
code: 2,
|
||||||
};
|
};
|
||||||
const obj3 = {
|
const obj3 = {
|
||||||
|
sort: 3,
|
||||||
name: '夜班',
|
name: '夜班',
|
||||||
startTime: '00:00:00',
|
startTime: '00:00:00',
|
||||||
endTime: '08:00:00',
|
endTime: '08:00:00',
|
||||||
daySpan: 0,
|
daySpan: 0,
|
||||||
code: 3,
|
code: 3,
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj1, obj2, obj3);
|
this.tableData1.push(obj1, obj2, obj3);
|
||||||
}
|
}
|
||||||
@@ -859,11 +886,37 @@ export default {
|
|||||||
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//班组改变顺序
|
||||||
|
handleSort(val) {
|
||||||
|
if (val.type == 'up') {
|
||||||
|
const temp = this.tableData2[val.index];
|
||||||
|
this.tableData2.splice(val.index, 1);
|
||||||
|
let i = 0;
|
||||||
|
//如果是数组第一个,再向上则放到最后
|
||||||
|
if (val.index == 0) {
|
||||||
|
i = this.tableData2.length;
|
||||||
|
} else {
|
||||||
|
i = val.index - 1;
|
||||||
|
}
|
||||||
|
this.tableData2.splice(i, 0, temp);
|
||||||
|
} else {
|
||||||
|
const temp = this.tableData2[val.index];
|
||||||
|
this.tableData2.splice(val.index, 1);
|
||||||
|
let i = 0;
|
||||||
|
//如果是数组最后一个,再向下则放到第一个(因为先splice(val.index, 1)所以这里length不用-1)
|
||||||
|
if (val.index == this.tableData2.length) {
|
||||||
|
i = 0;
|
||||||
|
} else {
|
||||||
|
i = val.index + 1;
|
||||||
|
}
|
||||||
|
this.tableData2.splice(i, 0, temp);
|
||||||
|
}
|
||||||
|
},
|
||||||
// 新增班组
|
// 新增班组
|
||||||
addNewGroup() {
|
addNewGroup() {
|
||||||
this.addOrUpdateVisible2 = true;
|
this.addOrUpdateVisible2 = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addGroupRef.init(this.dataForm.deptId,this.tableData2);
|
this.$refs.addGroupRef.init(this.dataForm.deptId, this.tableData2);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel1() {
|
cancel1() {
|
||||||
@@ -886,6 +939,15 @@ export default {
|
|||||||
},
|
},
|
||||||
refreshTableData1(index, val) {
|
refreshTableData1(index, val) {
|
||||||
this.tableData1.splice(index, 1, val);
|
this.tableData1.splice(index, 1, val);
|
||||||
|
this.tableData1.sort((a, b) => {
|
||||||
|
if (a.sort === b.sort) {
|
||||||
|
return -1; // sort相等时,a排在b前面
|
||||||
|
}
|
||||||
|
return a.sort - b.sort;
|
||||||
|
});
|
||||||
|
this.tableData1.forEach((item, index) => {
|
||||||
|
item.sort = index + 1;
|
||||||
|
});
|
||||||
this.cancel1();
|
this.cancel1();
|
||||||
},
|
},
|
||||||
refreshTableData2(val) {
|
refreshTableData2(val) {
|
||||||
@@ -895,22 +957,38 @@ export default {
|
|||||||
refreshTableData3(index, val) {
|
refreshTableData3(index, val) {
|
||||||
this.tableData2[index].bindLineTree = val;
|
this.tableData2[index].bindLineTree = val;
|
||||||
let lineName = '';
|
let lineName = '';
|
||||||
lineName = this.setLineName(val, lineName);
|
lineName = this.setLineName(val);
|
||||||
if (lineName) {
|
if (lineName) {
|
||||||
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
|
this.$set(this.tableData2[index], 'lineName', lineName);
|
||||||
}
|
}
|
||||||
this.cancel3();
|
this.cancel3();
|
||||||
},
|
},
|
||||||
//提取绑定的产线工段名展示出来
|
//提取绑定的产线工段名展示出来
|
||||||
setLineName(val, lineName) {
|
setLineName(val) {
|
||||||
val.forEach((item) => {
|
if (!val || val.length === 0) return '';
|
||||||
lineName += item.name + ':';
|
|
||||||
if (item.children && item.children.length > 0) {
|
const currentLevelNames = val.map((item) => item.name);
|
||||||
const childName = this.setLineName(item.children, lineName);
|
|
||||||
lineName = childName;
|
// 处理当前层级显示
|
||||||
|
let currentDisplay = '';
|
||||||
|
if (currentLevelNames.length > 1) {
|
||||||
|
currentDisplay = `(${currentLevelNames.join(' 、 ')})`;
|
||||||
|
} else {
|
||||||
|
currentDisplay = currentLevelNames[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找所有子节点(取第一个有子节点的元素)
|
||||||
|
const childNode = val.find(
|
||||||
|
(item) => item.children && item.children.length > 0
|
||||||
|
);
|
||||||
|
if (childNode) {
|
||||||
|
const childPath = this.setLineName(childNode.children);
|
||||||
|
if (childPath) {
|
||||||
|
return `${currentDisplay} / ${childPath}`;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return lineName;
|
|
||||||
|
return currentDisplay;
|
||||||
},
|
},
|
||||||
//第三步
|
//第三步
|
||||||
// 进来加载预览排班
|
// 进来加载预览排班
|
||||||
@@ -919,6 +997,7 @@ export default {
|
|||||||
id: this.dataForm.id,
|
id: this.dataForm.id,
|
||||||
count: day,
|
count: day,
|
||||||
};
|
};
|
||||||
|
this.period = day;
|
||||||
this.tableProps3 = [];
|
this.tableProps3 = [];
|
||||||
this.tableData3 = [];
|
this.tableData3 = [];
|
||||||
getPerView(data).then((res) => {
|
getPerView(data).then((res) => {
|
||||||
@@ -946,6 +1025,7 @@ export default {
|
|||||||
label: item.day,
|
label: item.day,
|
||||||
work: item.work,
|
work: item.work,
|
||||||
subcomponent: propSpan,
|
subcomponent: propSpan,
|
||||||
|
showOverflowtooltip: true,
|
||||||
};
|
};
|
||||||
this.tableProps3.push(obj);
|
this.tableProps3.push(obj);
|
||||||
item.det.forEach((sItem, sIndex) => {
|
item.det.forEach((sItem, sIndex) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-21 14:27:23
|
* @Date: 2025-10-21 14:27:23
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-21 15:02:27
|
* @LastEditTime: 2025-11-04 10:49:16
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="title">创建人:</span>
|
<span class="title">创建人:</span>
|
||||||
{{ infoData.creator }}
|
{{ infoData.creatorName }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="title">创建时间:</span>
|
<span class="title">创建时间:</span>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-20 10:23:52
|
* @LastEditTime: 2025-11-04 14:08:47
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -15,9 +15,10 @@
|
|||||||
label-width="80px">
|
label-width="80px">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="序号" prop="index">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="dataForm.index"
|
style="width: 100%"
|
||||||
|
v-model="dataForm.sort"
|
||||||
:step="1"
|
:step="1"
|
||||||
:min="1"
|
:min="1"
|
||||||
step-strictly />
|
step-strictly />
|
||||||
@@ -38,7 +39,8 @@
|
|||||||
format="H:mm"
|
format="H:mm"
|
||||||
value-format="HH:mm:ss"
|
value-format="HH:mm:ss"
|
||||||
v-model="dataForm.startTime"
|
v-model="dataForm.startTime"
|
||||||
placeholder="选择日期时间"></el-time-picker>
|
@change="timeFun('start')"
|
||||||
|
placeholder="选择时间"></el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -48,7 +50,19 @@
|
|||||||
format="H:mm"
|
format="H:mm"
|
||||||
value-format="HH:mm:ss"
|
value-format="HH:mm:ss"
|
||||||
v-model="dataForm.endTime"
|
v-model="dataForm.endTime"
|
||||||
placeholder="选择日期时间"></el-time-picker>
|
@change="timeFun('end')"
|
||||||
|
placeholder="选择时间"></el-time-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否跨天" prop="daySpan">
|
||||||
|
<el-switch
|
||||||
|
v-model="dataForm.daySpan"
|
||||||
|
disabled
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
active-text="隔天"
|
||||||
|
inactive-text="当天"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -70,15 +84,17 @@ export default {
|
|||||||
return {
|
return {
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
index: undefined,
|
sort: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
|
daySpan: 0,
|
||||||
|
code: 1,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
},
|
},
|
||||||
_pageIndex: 1,
|
_pageIndex: 1,
|
||||||
dataRule: {
|
dataRule: {
|
||||||
index: [{ required: true, message: '序号不能为空', trigger: 'blur' }],
|
sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
|
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
@@ -93,13 +109,31 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(val) {
|
init(val) {
|
||||||
this._pageIndex = val._pageIndex-1;
|
this._pageIndex = val._pageIndex - 1;
|
||||||
this.dataForm.index = val._pageIndex || 1;
|
this.dataForm.sort = val._pageIndex || 1;
|
||||||
this.dataForm.name = val.name || undefined;
|
this.dataForm.name = val.name || undefined;
|
||||||
this.dataForm.startTime = val.startTime || undefined;
|
this.dataForm.startTime = val.startTime || undefined;
|
||||||
this.dataForm.endTime = val.endTime || undefined;
|
this.dataForm.endTime = val.endTime || undefined;
|
||||||
this.dataForm.remark = val.remark || undefined;
|
this.dataForm.remark = val.remark || undefined;
|
||||||
|
this.dataForm.daySpan = val.daySpan || 0;
|
||||||
|
this.dataForm.code = val.code || 1;
|
||||||
},
|
},
|
||||||
|
timeFun(val) {
|
||||||
|
if (this.dataForm.startTime && this.dataForm.endTime) {
|
||||||
|
if (this.dataForm.startTime > this.dataForm.endTime) {
|
||||||
|
this.dataForm.daySpan = 1
|
||||||
|
} else if (this.dataForm.startTime < this.dataForm.endTime) {
|
||||||
|
this.dataForm.daySpan = 0
|
||||||
|
} else {
|
||||||
|
if (val === 'start') {
|
||||||
|
this.dataForm.startTime = ''
|
||||||
|
} else {
|
||||||
|
this.dataForm.endTime = ''
|
||||||
|
}
|
||||||
|
this.$modal.msgWarning('班次开始时间和结束时间不能相同')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-11 14:27:37
|
* @Date: 2025-10-13 15:07:24
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-29 14:50:16
|
* @LastEditTime: 2025-11-05 08:51:13
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -31,12 +31,14 @@
|
|||||||
<el-form-item label="开始时间" prop="startDay">
|
<el-form-item label="开始时间" prop="startDay">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formInline.startDay"
|
v-model="formInline.startDay"
|
||||||
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择日期时间"></el-date-picker>
|
placeholder="选择日期时间"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="结束时间" prop="endDay">
|
<el-form-item label="结束时间" prop="endDay">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formInline.endDay"
|
v-model="formInline.endDay"
|
||||||
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择日期时间"></el-date-picker>
|
placeholder="选择日期时间"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -46,8 +48,12 @@
|
|||||||
ref="deptSelect"
|
ref="deptSelect"
|
||||||
@DeptId="setDeptId"></dept-select>
|
@DeptId="setDeptId"></dept-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="leaderName">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="formInline.status" placeholder="请选择状态">
|
<el-select
|
||||||
|
v-model="formInline.status"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -65,7 +71,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"
|
<span
|
||||||
|
class="separateStyle"
|
||||||
v-hasPermi="['base:group-scheduling-plan:query']"></span>
|
v-hasPermi="['base:group-scheduling-plan:query']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -74,7 +81,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"
|
<span
|
||||||
|
class="separateStyle"
|
||||||
v-hasPermi="['base:group-scheduling-plan:create']"></span>
|
v-hasPermi="['base:group-scheduling-plan:create']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -87,6 +95,17 @@
|
|||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
size="small"
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['base:group-scheduling-plan:export']">
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<base-table
|
<base-table
|
||||||
@@ -201,6 +220,7 @@ import {
|
|||||||
copyPlan,
|
copyPlan,
|
||||||
disablePlan,
|
disablePlan,
|
||||||
updateScheduleLater,
|
updateScheduleLater,
|
||||||
|
exportExcel,
|
||||||
} from '@/api/group/Schedule';
|
} from '@/api/group/Schedule';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
@@ -268,91 +288,97 @@ export default {
|
|||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:group-scheduling-plan:update')?
|
this.$auth.hasPermi('base:group-scheduling-plan:update')
|
||||||
{
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
showParam: {
|
showParam: {
|
||||||
type: '&',
|
type: '&',
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
type: 'equal',
|
type: 'equal',
|
||||||
name: 'status',
|
name: 'status',
|
||||||
value: 1,
|
value: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
}
|
||||||
},
|
: undefined,
|
||||||
}:undefined,
|
this.$auth.hasPermi('base:group-scheduling-plan:delete')
|
||||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
? {
|
||||||
{
|
type: 'delete',
|
||||||
type: 'delete',
|
btnName: '删除',
|
||||||
btnName: '删除',
|
showParam: {
|
||||||
showParam: {
|
type: '&',
|
||||||
type: '&',
|
data: [
|
||||||
data: [
|
{
|
||||||
{
|
type: 'equal',
|
||||||
type: 'equal',
|
name: 'status',
|
||||||
name: 'status',
|
value: 1,
|
||||||
value: 1,
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
}
|
||||||
},
|
: undefined,
|
||||||
}:undefined,
|
this.$auth.hasPermi('base:group-scheduling-plan:query')
|
||||||
this.$auth.hasPermi('base:group-scheduling-plan:query')?
|
? {
|
||||||
{
|
type: 'detail',
|
||||||
type: 'detail',
|
btnName: '查看',
|
||||||
btnName: '查看',
|
showParam: {
|
||||||
showParam: {
|
type: '&',
|
||||||
type: '&',
|
data: [
|
||||||
data: [
|
{
|
||||||
{
|
type: 'unequal',
|
||||||
type: 'unequal',
|
name: 'status',
|
||||||
name: 'status',
|
value: 1,
|
||||||
value: 1,
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
}
|
||||||
},
|
: undefined,
|
||||||
}:undefined,
|
this.$auth.hasPermi('base:group-scheduling-plan:delete')
|
||||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
? {
|
||||||
{
|
type: 'cancel',
|
||||||
type: 'cancel',
|
btnName: '作废',
|
||||||
btnName: '作废',
|
showParam: {
|
||||||
showParam: {
|
type: '&',
|
||||||
type: '&',
|
data: [
|
||||||
data: [
|
{
|
||||||
{
|
type: 'equal',
|
||||||
type: 'equal',
|
name: 'status',
|
||||||
name: 'status',
|
value: 2,
|
||||||
value: 2,
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
}
|
||||||
},
|
: undefined,
|
||||||
}:undefined,
|
this.$auth.hasPermi('base:group-holiday:update')
|
||||||
this.$auth.hasPermi('base:group-holiday:update')?
|
? {
|
||||||
{
|
type: 'sync',
|
||||||
type: 'sync',
|
btnName: '同步节假日',
|
||||||
btnName: '同步节假日',
|
showParam: {
|
||||||
showParam: {
|
type: '&',
|
||||||
type: '&',
|
data: [
|
||||||
data: [
|
{
|
||||||
{
|
type: 'equal',
|
||||||
type: 'equal',
|
name: 'status',
|
||||||
name: 'status',
|
value: 2,
|
||||||
value: 2,
|
},
|
||||||
|
{
|
||||||
|
type: 'equal',
|
||||||
|
name: 'updateFlag',
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
}
|
||||||
type: 'equal',
|
: undefined,
|
||||||
name: 'updateFlag',
|
this.$auth.hasPermi('base:group-scheduling-plan:create')
|
||||||
value: true,
|
? {
|
||||||
},
|
type: 'copy',
|
||||||
],
|
btnName: '复制',
|
||||||
},
|
}
|
||||||
}:undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:group-scheduling-plan:create')?
|
|
||||||
{
|
|
||||||
type: 'copy',
|
|
||||||
btnName: '复制',
|
|
||||||
}:undefined,
|
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
options: [
|
options: [
|
||||||
@@ -379,12 +405,14 @@ export default {
|
|||||||
},
|
},
|
||||||
stepNum: 1, // 新增编辑时当前第几步
|
stepNum: 1, // 新增编辑时当前第几步
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
|
// 导出遮罩层
|
||||||
|
exportLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
deptSelect,
|
deptSelect,
|
||||||
detail
|
detail,
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -411,7 +439,7 @@ export default {
|
|||||||
this.formInline.code = null;
|
this.formInline.code = null;
|
||||||
this.formInline.deptId = null;
|
this.formInline.deptId = null;
|
||||||
this.$refs.deptSelect.clear();
|
this.$refs.deptSelect.clear();
|
||||||
this.formInline.leaderName = null;
|
this.formInline.status = null;
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -474,23 +502,44 @@ export default {
|
|||||||
} else if (val.type === 'cancel') {
|
} else if (val.type === 'cancel') {
|
||||||
disablePlan(val.data.id).then((res) => {
|
disablePlan(val.data.id).then((res) => {
|
||||||
this.$modal.msgSuccess('作废成功');
|
this.$modal.msgSuccess('作废成功');
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
});
|
});
|
||||||
} else if (val.type === 'sync') {
|
} else if (val.type === 'sync') {
|
||||||
updateScheduleLater({ planId: val.data.id }).then((res) => {
|
updateScheduleLater({
|
||||||
|
planId: val.data.id,
|
||||||
|
logId: val.data.updateLogId,
|
||||||
|
}).then((res) => {
|
||||||
this.$modal.msgSuccess('同步节假日成功');
|
this.$modal.msgSuccess('同步节假日成功');
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
});
|
});
|
||||||
} else if (val.type === 'copy') {
|
} else if (val.type === 'copy') {
|
||||||
copyPlan(val.data.id).then((res) => {
|
copyPlan(val.data.id).then((res) => {
|
||||||
this.$modal.msgSuccess('复制成功');
|
this.$modal.msgSuccess('复制成功');
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
detailCancel() {
|
detailCancel() {
|
||||||
this.detailVisible = false;
|
this.detailVisible = false;
|
||||||
},
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.formInline };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有数据项?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '排班计划.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
44
src/views/group/Schedule/sortSet.vue
Normal file
44
src/views/group/Schedule/sortSet.vue
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:40:08
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-04 16:08:57
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-button type="text" size="mini" @click="moveUp()" style="display:inline-block">↑</el-button>
|
||||||
|
<el-button type="text" size="mini" @click="moveDown()" style="display:inline-block;float:right">↓</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
moveUp() {
|
||||||
|
const val = {
|
||||||
|
type: 'up',
|
||||||
|
index: this.injectData._pageIndex - 1,
|
||||||
|
};
|
||||||
|
this.$emit('emitData', val);
|
||||||
|
},
|
||||||
|
moveDown() {
|
||||||
|
const val = {
|
||||||
|
type: 'down',
|
||||||
|
index: this.injectData._pageIndex - 1,
|
||||||
|
};
|
||||||
|
this.$emit('emitData', val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-13 16:18:41
|
* @Date: 2025-10-13 16:18:41
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-20 10:13:26
|
* @LastEditTime: 2025-11-04 10:54:19
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
injectData.shiftSustainedNum +
|
(injectData.shiftSustainedNum?injectData.shiftSustainedNum:'') +
|
||||||
(injectData.shiftSustainedType
|
(injectData.shiftSustainedType
|
||||||
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
|
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
|
||||||
: '')
|
: '')
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ export default {
|
|||||||
this.deptId = id;
|
this.deptId = id;
|
||||||
},
|
},
|
||||||
clear() {
|
clear() {
|
||||||
console.log(this.$refs.treeselect);
|
|
||||||
this.$refs.treeselect.clear();
|
this.$refs.treeselect.clear();
|
||||||
},
|
},
|
||||||
// 格式化部门的下拉框
|
// 格式化部门的下拉框
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-29 14:47:33
|
* @LastEditTime: 2025-10-31 15:47:16
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -31,10 +31,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="部门">
|
<el-form-item label="部门" prop="deptId">
|
||||||
<dept-select
|
<dept-select
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
ref="deptSelect"
|
ref="deptSelect"
|
||||||
|
v-model="dataForm.deptId"
|
||||||
@DeptId="setDeptId"></dept-select>
|
@DeptId="setDeptId"></dept-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-model="dataForm.leaderId"
|
v-model="dataForm.leaderId"
|
||||||
@change="setLeaderName"
|
@change="setLeaderName"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择组长">
|
placeholder="请选择组长">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in leaderArr"
|
v-for="item in leaderArr"
|
||||||
@@ -59,7 +60,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.leaderPhone"
|
v-model="dataForm.leaderPhone"
|
||||||
clearable
|
clearable
|
||||||
maxlength="11"
|
maxlength="11"
|
||||||
placeholder="请输入组长电话" />
|
placeholder="请输入组长电话" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -137,7 +138,7 @@ export default {
|
|||||||
num: undefined,
|
num: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
},
|
},
|
||||||
setData: true,
|
setData: true,
|
||||||
leaderArr: [],
|
leaderArr: [],
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
@@ -156,19 +157,23 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: '班组名称不能为空', trigger: 'blur' },
|
{ required: true, message: '班组名称不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
|
deptId: [
|
||||||
|
{ required: true, message: '部门不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
leaderId: [
|
leaderId: [
|
||||||
{ required: true, message: '组长不能为空', trigger: 'change' },
|
{ required: true, message: '组长不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
isProduction: [
|
isProduction: [
|
||||||
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
leaderPhone: [
|
leaderPhone: [
|
||||||
{
|
{
|
||||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
pattern:
|
||||||
message: "请输入正确的手机号码",
|
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
trigger: "blur"
|
message: '请输入正确的手机号码',
|
||||||
}
|
trigger: 'blur',
|
||||||
]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -184,9 +189,9 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
setDataForm(){
|
setDataForm() {
|
||||||
this.$refs.deptSelect.setID(this.dataForm.deptId)
|
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||||
},
|
},
|
||||||
setLeaderName(val) {
|
setLeaderName(val) {
|
||||||
this.leaderArr.map((item) => {
|
this.leaderArr.map((item) => {
|
||||||
if (val === item.id) {
|
if (val === item.id) {
|
||||||
@@ -194,33 +199,33 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs["dataForm"].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!this.dataForm.deptId){
|
if (!this.dataForm.deptId) {
|
||||||
this.$message('部门不能为空');
|
this.$message('部门不能为空');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
this.urlOptions.updateURL(this.dataForm).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("refreshDataList");
|
this.$emit('refreshDataList');
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
this.urlOptions.createURL(this.dataForm).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("refreshDataList");
|
this.$emit('refreshDataList');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-23 13:29:58
|
* @LastEditTime: 2025-11-05 13:43:53
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="节假日名称" prop="name">
|
<el-form-item label="节假日名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
|
ref="inputWidth"
|
||||||
v-model="dataForm.name"
|
v-model="dataForm.name"
|
||||||
clearable
|
clearable
|
||||||
:disabled="detail"
|
:disabled="detail"
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="dataForm.dateType == 1"
|
v-if="dataForm.dateType == 1 && dataForm.calendarType == 1"
|
||||||
label="日期"
|
label="日期"
|
||||||
prop="dateDay">
|
prop="dateDay">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -66,9 +67,13 @@
|
|||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy-MM-dd"
|
format="yyyy-MM-dd"
|
||||||
value-format="--MM-dd"
|
value-format="--MM-dd"
|
||||||
|
@blur="$forceUpdate()"
|
||||||
:picker-options="pickerOptions"></el-date-picker>
|
:picker-options="pickerOptions"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-else label="日期" prop="dateDayArr">
|
<el-form-item
|
||||||
|
v-else-if="dataForm.dateType == 2 && dataForm.calendarType == 1"
|
||||||
|
label="日期"
|
||||||
|
prop="dateDayArr">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="detail"
|
:disabled="detail"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@@ -80,8 +85,53 @@
|
|||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
|
@blur="$forceUpdate()"
|
||||||
:picker-options="pickerOptions"></el-date-picker>
|
:picker-options="pickerOptions"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-else-if="dataForm.dateType == 1 && dataForm.calendarType == 2"
|
||||||
|
label="日期"
|
||||||
|
prop="dateDayChinese">
|
||||||
|
<j-date-picker
|
||||||
|
ref="JDatePicker1"
|
||||||
|
style="line-height: 18px"
|
||||||
|
v-model="dataForm.dateDayChinese"
|
||||||
|
id="value1"
|
||||||
|
:width="width1"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
:rangeSeparator="rangeSeparator"
|
||||||
|
@change="onDateChange"
|
||||||
|
:disabled="detail"
|
||||||
|
:showLunarClass="showLunarClass"
|
||||||
|
:showLunarControl="showLunarControl"
|
||||||
|
type="DATE"
|
||||||
|
:showBackYears="showBackYears"
|
||||||
|
:showLunarIcon="showLunarIcon"
|
||||||
|
:format="format"></j-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-else-if="dataForm.dateType == 2 && dataForm.calendarType == 2"
|
||||||
|
label="日期"
|
||||||
|
prop="dateDayArrChinese">
|
||||||
|
<j-date-picker
|
||||||
|
style="line-height: 18px"
|
||||||
|
ref="JDatePicker2"
|
||||||
|
v-model="dataForm.dateDayArrChinese"
|
||||||
|
id="value2"
|
||||||
|
:width="width1"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
:rangeSeparator="rangeSeparator"
|
||||||
|
@change="onDateChange"
|
||||||
|
:disabled="detail"
|
||||||
|
:showLunarClass="showLunarClass"
|
||||||
|
:showLunarControl="showLunarControl"
|
||||||
|
type="DATERANGE"
|
||||||
|
:showBackYears="showBackYears"
|
||||||
|
:showLunarIcon="showLunarIcon"
|
||||||
|
:format="format"></j-date-picker>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="是否每年重复" prop="repeat">
|
<el-form-item label="是否每年重复" prop="repeat">
|
||||||
@@ -131,6 +181,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import JDatePicker from 'vue-jlunar-datepicker';
|
||||||
import {
|
import {
|
||||||
createHoliday,
|
createHoliday,
|
||||||
updateHoliday,
|
updateHoliday,
|
||||||
@@ -141,7 +192,9 @@ import {
|
|||||||
} from '@/api/group/holidaySetting';
|
} from '@/api/group/holidaySetting';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {
|
||||||
|
JDatePicker,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataForm: {
|
dataForm: {
|
||||||
@@ -151,6 +204,10 @@ export default {
|
|||||||
dateType: 1,
|
dateType: 1,
|
||||||
dateDay: undefined,
|
dateDay: undefined,
|
||||||
dateDayArr: [],
|
dateDayArr: [],
|
||||||
|
dateDayChinese: undefined,
|
||||||
|
dateDayArrChinese: [],
|
||||||
|
noRepeatYear: undefined,
|
||||||
|
noRepeatYearChinese: undefined,
|
||||||
repeat: true,
|
repeat: true,
|
||||||
inherited: true, // 是否为继承
|
inherited: true, // 是否为继承
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
@@ -202,6 +259,12 @@ export default {
|
|||||||
dateDayArr: [
|
dateDayArr: [
|
||||||
{ required: true, message: '日期不能为空', trigger: 'change' },
|
{ required: true, message: '日期不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
|
dateDayChinese: [
|
||||||
|
{ required: true, message: '日期不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
dateDayArrChinese: [
|
||||||
|
{ required: true, message: '日期不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
repeat: [
|
repeat: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -216,12 +279,61 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
//农历组件数据
|
||||||
|
showLunarClass: 'LUNAR', //农历日期的展示类型 MIX(混合)FULLLUNAR(全农历)LUNAR(农历)NUMBER(数字)
|
||||||
|
showBackYears: 2, //向后展示年数;见于年份列表;
|
||||||
|
showLunarIcon: true, //是否显示农历控制组件
|
||||||
|
showLunarControl: false, //是否显示农历控制组件
|
||||||
|
width1: '300', //这个设置成100%,原组件写死了px需要修改
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
placeholder: '',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
editable: true,
|
||||||
|
clearable: true,
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() < Date.now() - 8.64e7;
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
'dataForm.calendarType': function (newValue, oldValue) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.JDatePicker1) {
|
||||||
|
this.$refs.JDatePicker1.isLunar = true; //默认转为农历
|
||||||
|
this.$refs.JDatePicker1.onLunarChange();
|
||||||
|
}
|
||||||
|
if (this.$refs.JDatePicker2) {
|
||||||
|
this.$refs.JDatePicker2.isLunar = true;
|
||||||
|
this.$refs.JDatePicker2.onLunarChange();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'dataForm.dateType': function (newValue, oldValue) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.JDatePicker1) {
|
||||||
|
this.$refs.JDatePicker1.isLunar = true; //默认转为农历
|
||||||
|
this.$refs.JDatePicker1.onLunarChange();
|
||||||
|
}
|
||||||
|
if (this.$refs.JDatePicker2) {
|
||||||
|
this.$refs.JDatePicker2.isLunar = true;
|
||||||
|
this.$refs.JDatePicker2.onLunarChange();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.width1 = this.$refs.inputWidth.$el.offsetWidth + '';
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(deptId, id, detail) {
|
init(deptId, val, detail) {
|
||||||
this.dataForm.deptId = deptId || undefined;
|
this.dataForm.deptId = deptId || undefined;
|
||||||
this.dataForm.id = id || undefined;
|
this.dataForm.id = val.holidayId || undefined;
|
||||||
|
this.dataForm.inherited = val.isInherit || false;
|
||||||
this.detail = detail || false;
|
this.detail = detail || false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs['dataForm'].resetFields();
|
this.$refs['dataForm'].resetFields();
|
||||||
@@ -245,14 +357,21 @@ export default {
|
|||||||
this.dataForm.dateType == 1 &&
|
this.dataForm.dateType == 1 &&
|
||||||
this.dataForm.calendarType == 2
|
this.dataForm.calendarType == 2
|
||||||
) {
|
) {
|
||||||
this.dataForm.dateDay = this.dataForm.oneDayChinese;
|
this.dataForm.dateDayChinese =
|
||||||
|
'L' +
|
||||||
|
new Date().getFullYear() +
|
||||||
|
this.dataForm.oneDayChinese.slice(-6);
|
||||||
} else if (
|
} else if (
|
||||||
this.dataForm.dateType == 2 &&
|
this.dataForm.dateType == 2 &&
|
||||||
this.dataForm.calendarType == 2
|
this.dataForm.calendarType == 2
|
||||||
) {
|
) {
|
||||||
this.dataForm.dateDayArr = [
|
this.dataForm.dateDayArrChinese = [
|
||||||
this.dataForm.startDayChinese,
|
'L' +
|
||||||
this.dataForm.endDayChinese,
|
new Date().getFullYear() +
|
||||||
|
this.dataForm.startDayChinese.slice(-6),
|
||||||
|
'L' +
|
||||||
|
new Date().getFullYear() +
|
||||||
|
this.dataForm.endDayChinese.slice(-6),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -307,10 +426,13 @@ export default {
|
|||||||
this.$modal.msgSuccess('删除成功');
|
this.$modal.msgSuccess('删除成功');
|
||||||
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
this.$modal.msgSuccess('更新成功');
|
this.$modal.msgSuccess('更新成功');
|
||||||
this.$emit('refreshPage');
|
|
||||||
});
|
});
|
||||||
|
this.$emit('refreshPage');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onDateChange(val) {
|
||||||
|
console.log(val);
|
||||||
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
@@ -329,25 +451,57 @@ export default {
|
|||||||
this.dataForm.dateType == 1 &&
|
this.dataForm.dateType == 1 &&
|
||||||
this.dataForm.calendarType == 2
|
this.dataForm.calendarType == 2
|
||||||
) {
|
) {
|
||||||
this.dataForm.oneDayChinese = this.dataForm.dateDay;
|
this.dataForm.oneDayChinese =
|
||||||
|
'--' + this.dataForm.dateDayChinese.slice(-5);
|
||||||
} else if (
|
} else if (
|
||||||
this.dataForm.dateType == 2 &&
|
this.dataForm.dateType == 2 &&
|
||||||
this.dataForm.calendarType == 2
|
this.dataForm.calendarType == 2
|
||||||
) {
|
) {
|
||||||
this.dataForm.startDayChinese = this.dataForm.dateDayArr[0];
|
this.dataForm.startDayChinese =
|
||||||
this.dataForm.endDayChinese = this.dataForm.dateDayArr[1];
|
'--' + this.dataForm.dateDayArrChinese[0].slice(-5);
|
||||||
|
this.dataForm.endDayChinese =
|
||||||
|
'--' + this.dataForm.dateDayArrChinese[1].slice(-5);
|
||||||
|
}
|
||||||
|
if (this.dataForm.calendarType == 1 && !this.dataForm.repeat) {
|
||||||
|
this.dataForm.noRepeatYear = new Date().getFullYear();
|
||||||
|
} else if (this.dataForm.calendarType == 2 && !this.dataForm.repeat) {
|
||||||
|
this.dataForm.noRepeatYearChinese = new Date().getFullYear();
|
||||||
}
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
updateHoliday(this.dataForm).then((response) => {
|
updateHoliday(this.dataForm).then((res) => {
|
||||||
this.$modal.msgSuccess('修改成功');
|
if (!res.data.updateFlag) {
|
||||||
this.$emit('refreshPage');
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
'新增节假日影响已有排班计划,是否立即更新?',
|
||||||
|
'更新排班',
|
||||||
|
{
|
||||||
|
confirmButtonText: '立即更新',
|
||||||
|
cancelButtonText: '暂不更新',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
});
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
createHoliday(this.dataForm).then((res) => {
|
createHoliday(this.dataForm).then((res) => {
|
||||||
updateSchedule;
|
|
||||||
if (!res.data.updateFlag) {
|
if (!res.data.updateFlag) {
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.$emit('refreshPage');
|
this.$emit('refreshPage');
|
||||||
@@ -363,15 +517,16 @@ export default {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('更新成功');
|
||||||
this.$emit('refreshPage');
|
|
||||||
});
|
});
|
||||||
|
this.$emit('refreshPage');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消',
|
message: '已取消',
|
||||||
});
|
});
|
||||||
|
this.$emit('refreshPage');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ const tableProps = [
|
|||||||
prop: 'opPeopleName',
|
prop: 'opPeopleName',
|
||||||
label: '操作人'
|
label: '操作人'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'deptName',
|
||||||
|
label: '部门'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'opType',
|
prop: 'opType',
|
||||||
label: '操作类型',
|
label: '操作类型',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2024-07-01 14:54:06
|
* @Date: 2024-07-01 14:54:06
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-27 10:18:54
|
* @LastEditTime: 2025-11-05 13:46:00
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -32,15 +32,24 @@
|
|||||||
<div class="groupTeamScheduling">
|
<div class="groupTeamScheduling">
|
||||||
<div class="operationArea">
|
<div class="operationArea">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="16">
|
<el-col :span="6">
|
||||||
<div style="height: 40px; font-size: 16px">
|
<div style="height: 40px; font-size: 16px">
|
||||||
<span style="color: #409eff; font-weight: 600">
|
<span style="color: #409eff; font-weight: 600">
|
||||||
{{ showDeptName }}
|
{{ showDeptName }}
|
||||||
</span>
|
</span>
|
||||||
节假日设置
|
节假日设置
|
||||||
|
<span
|
||||||
|
:style="{
|
||||||
|
color: inherited ? '#67c23a' : '#b5b839',
|
||||||
|
fontSize: '12px',
|
||||||
|
fontWeight: 600,
|
||||||
|
}"
|
||||||
|
v-show="ishasParent">
|
||||||
|
{{ inherited ? '继承模式' : '自定义模式' }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="18" v-if="!ishasParent">
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
@@ -58,6 +67,39 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="18" v-else style="text-align: right">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
:disabled="inherited"
|
||||||
|
v-hasPermi="['base:group-holiday:create']"
|
||||||
|
@click="addHoliday">
|
||||||
|
新增节假日
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="success"
|
||||||
|
:disabled="inherited"
|
||||||
|
v-hasPermi="['base:group-holiday:update']"
|
||||||
|
@click="reExtends">
|
||||||
|
恢复继承
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="warning"
|
||||||
|
:disabled="!inherited"
|
||||||
|
v-hasPermi="['base:group-holiday:update']"
|
||||||
|
@click="disExtends">
|
||||||
|
解除继承
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
:disabled="inherited"
|
||||||
|
v-hasPermi="['base:group-holiday-log:query']"
|
||||||
|
@click="holidayLog">
|
||||||
|
节假日变更记录
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="operationArea">
|
<div class="operationArea">
|
||||||
@@ -73,6 +115,24 @@
|
|||||||
:clearable="false"
|
:clearable="false"
|
||||||
style="width: 120px"></el-date-picker>
|
style="width: 120px"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="继承上一级的节假日" v-show="ishasParent">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background-color: #67c23a;
|
||||||
|
border-radius: 3px;
|
||||||
|
"></div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="本级自定义的节假日" v-show="ishasParent">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background-color: #b5b839;
|
||||||
|
border-radius: 3px;
|
||||||
|
"></div>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
@@ -83,15 +143,24 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-if="topDeptId == deptId"
|
v-if="!ishasParent"
|
||||||
type="warning"
|
type="warning"
|
||||||
closable
|
|
||||||
style="margin-bottom: 10px; color: black">
|
style="margin-bottom: 10px; color: black">
|
||||||
<i class="el-icon-warning" style="color: #ffbd02"></i>
|
<i class="el-icon-warning" style="color: #ffbd02"></i>
|
||||||
当前节假日设置为组织架构中最高层级配置,默认自动继承至下属部门。子部门可选择
|
当前节假日设置为组织架构中最高层级配置,默认自动继承至下属部门。子部门可选择
|
||||||
<span style="color: red">解除继承</span>
|
<span style="color: red">解除继承</span>
|
||||||
设置后进行独立修改,复制后不再继承上级设置
|
设置后进行独立修改,复制后不再继承上级设置
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
<el-tag
|
||||||
|
v-else
|
||||||
|
type="warning"
|
||||||
|
closable
|
||||||
|
style="margin-bottom: 10px; color: black">
|
||||||
|
<i class="el-icon-warning" style="color: #ffbd02"></i>
|
||||||
|
当前部门继承上级节假日设置,默认不可修改。可通过
|
||||||
|
<span style="color: red">解除继承</span>
|
||||||
|
进行自定义,解除后将不再继承。
|
||||||
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<!-- 日历区域 -->
|
<!-- 日历区域 -->
|
||||||
<div class="calenderArea">
|
<div class="calenderArea">
|
||||||
@@ -99,7 +168,16 @@
|
|||||||
<template slot="dateCell" slot-scope="{ data }">
|
<template slot="dateCell" slot-scope="{ data }">
|
||||||
<div v-if="data.type === 'current-month'">
|
<div v-if="data.type === 'current-month'">
|
||||||
<!-- 日期 -->
|
<!-- 日期 -->
|
||||||
<div class="dateStyle">
|
<div
|
||||||
|
class="dateStyle"
|
||||||
|
@click="
|
||||||
|
new Date(data.day).getTime() > Date.now() &&
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.isHoliday &&
|
||||||
|
showDetail(
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
)
|
||||||
|
">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 公历和农历 -->
|
<!-- 公历和农历 -->
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
@@ -134,13 +212,14 @@
|
|||||||
">
|
">
|
||||||
<div
|
<div
|
||||||
class="holiday-div"
|
class="holiday-div"
|
||||||
@click="
|
:style="{
|
||||||
new Date(data.day).getTime() > Date.now() &&
|
backgroundColor: ishasParent
|
||||||
showDetail(
|
? HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
.isInherit
|
||||||
.holidayId
|
? '#67c23a'
|
||||||
)
|
: '#b5b839'
|
||||||
">
|
: '',
|
||||||
|
}">
|
||||||
{{
|
{{
|
||||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
?.holidayName
|
?.holidayName
|
||||||
@@ -179,6 +258,7 @@
|
|||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
:before-close="cancel"
|
:before-close="cancel"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
|
class="addDialog"
|
||||||
width="40%">
|
width="40%">
|
||||||
<add-or-updata
|
<add-or-updata
|
||||||
ref="addOrUpdataRef"
|
ref="addOrUpdataRef"
|
||||||
@@ -252,7 +332,14 @@ import moment from 'moment';
|
|||||||
import { solarToLunar } from 'chinese-lunar';
|
import { solarToLunar } from 'chinese-lunar';
|
||||||
|
|
||||||
import { getUserProfile } from '@/api/system/user';
|
import { getUserProfile } from '@/api/system/user';
|
||||||
import { deptHolidayList, getEnableData } from '@/api/group/holidaySetting';
|
import {
|
||||||
|
deptHolidayList,
|
||||||
|
getEnableData,
|
||||||
|
disExtends,
|
||||||
|
reExtends,
|
||||||
|
updateSchedule,
|
||||||
|
getSet,
|
||||||
|
} from '@/api/group/holidaySetting';
|
||||||
|
|
||||||
import addOrUpdata from './add-or-updata.vue';
|
import addOrUpdata from './add-or-updata.vue';
|
||||||
import holidayLog from './holidayLog';
|
import holidayLog from './holidayLog';
|
||||||
@@ -274,7 +361,9 @@ export default {
|
|||||||
// 选择的部门名称
|
// 选择的部门名称
|
||||||
showDeptName: undefined,
|
showDeptName: undefined,
|
||||||
topDeptId: undefined, // 保存当前用户的部门id为最高级部门id
|
topDeptId: undefined, // 保存当前用户的部门id为最高级部门id
|
||||||
|
parentId: undefined, // 保存部门点击时对象的父id,用于解除和恢复继承
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
|
ishasParent: false, // 判断是否有上级,false,则表示为最高级
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
@@ -283,6 +372,7 @@ export default {
|
|||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
detail: false,
|
detail: false,
|
||||||
logVisible: false,
|
logVisible: false,
|
||||||
|
inherited: true, //该部门是否为继承状态
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -298,9 +388,9 @@ export default {
|
|||||||
this.showDeptName = response.data.dept.name || '';
|
this.showDeptName = response.data.dept.name || '';
|
||||||
this.topDeptId = response.data.dept.id || ''; // 保存当前用户的部门id为最高级部门id
|
this.topDeptId = response.data.dept.id || ''; // 保存当前用户的部门id为最高级部门id
|
||||||
this.deptId = response.data.dept.id || '';
|
this.deptId = response.data.dept.id || '';
|
||||||
this.getHolidayPage();
|
this.getTreeselect();
|
||||||
|
this.getSet();
|
||||||
});
|
});
|
||||||
this.getTreeselect();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHolidayPage() {
|
getHolidayPage() {
|
||||||
@@ -329,11 +419,23 @@ export default {
|
|||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
getEnableData().then((response) => {
|
getEnableData().then((response) => {
|
||||||
|
// 遍历部门,判断当前帐号的部门是否有为最上级
|
||||||
|
const nowDept = response.data.filter((i) => i.id == this.topDeptId);
|
||||||
|
this.ishasParent = nowDept.hasParent;
|
||||||
|
this.parentId = nowDept.parentId;
|
||||||
|
|
||||||
// 处理 deptOptions 参数
|
// 处理 deptOptions 参数
|
||||||
this.deptOptions = [];
|
this.deptOptions = [];
|
||||||
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 根据部门id查询该部门是否是继承
|
||||||
|
getSet() {
|
||||||
|
getSet({ id: this.deptId }).then((res) => {
|
||||||
|
this.inherited = res.data;
|
||||||
|
});
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
// 筛选节点
|
// 筛选节点
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
@@ -343,6 +445,9 @@ export default {
|
|||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
this.deptId = data.id;
|
this.deptId = data.id;
|
||||||
this.showDeptName = data.name;
|
this.showDeptName = data.name;
|
||||||
|
this.ishasParent = data.hasParent;
|
||||||
|
this.parentId = data.parentId;
|
||||||
|
this.getSet();
|
||||||
this.getHolidayPage();
|
this.getHolidayPage();
|
||||||
},
|
},
|
||||||
//获取农历
|
//获取农历
|
||||||
@@ -414,9 +519,108 @@ export default {
|
|||||||
this.detail = false;
|
this.detail = false;
|
||||||
this.dialogTitle = '新增节假日';
|
this.dialogTitle = '新增节假日';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdataRef.init(this.deptId);
|
this.$refs.addOrUpdataRef.init(this.deptId, {
|
||||||
|
inherited: this.inherited,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
disExtends() {
|
||||||
|
this.$confirm(
|
||||||
|
'当前节假日设置继承自上级部门,解除继承后将不再自动同步上级设置。<br/>系统将保留当前节假日配置作为初始数据,您可以自定义修改。<br/>是否确认解除继承?',
|
||||||
|
'解除继承',
|
||||||
|
{
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确认解除',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
disExtends({ id: this.deptId, pid: this.parentId }).then((res) => {
|
||||||
|
if (!res.data.updateFlag) {
|
||||||
|
this.$modal.msgSuccess('操作成功');
|
||||||
|
this.getSet();
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
'新增节假日影响已有排班计划,是否立即更新?',
|
||||||
|
'更新排班',
|
||||||
|
{
|
||||||
|
confirmButtonText: '立即更新',
|
||||||
|
cancelButtonText: '暂不更新',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
this.getSet();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
reExtends() {
|
||||||
|
this.$confirm(
|
||||||
|
'恢复继承后,当前部门将重新同步未来时间的上级部门的节假日设置,<br/>现有自定义配置将被清空并替换为上级设置,不可恢复。<br/>是否确认继续?',
|
||||||
|
'恢复继承',
|
||||||
|
{
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确认恢复继承',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
reExtends({ id: this.deptId, pid: this.parentId }).then((res) => {
|
||||||
|
if (!res.data.updateFlag) {
|
||||||
|
this.$modal.msgSuccess('操作成功');
|
||||||
|
this.getSet();
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
'新增节假日影响已有排班计划,是否立即更新?',
|
||||||
|
'更新排班',
|
||||||
|
{
|
||||||
|
confirmButtonText: '立即更新',
|
||||||
|
cancelButtonText: '暂不更新',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
this.getSet();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
holidayLog() {
|
holidayLog() {
|
||||||
this.logVisible = true;
|
this.logVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -434,12 +638,12 @@ export default {
|
|||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.$refs.addOrUpdataRef.dataFormSubmit();
|
this.$refs.addOrUpdataRef.dataFormSubmit();
|
||||||
},
|
},
|
||||||
showDetail(id) {
|
showDetail(val) {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
this.detail = true;
|
this.detail = true;
|
||||||
this.dialogTitle = '节假日详情';
|
this.dialogTitle = '节假日详情';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdataRef.init(this.deptId, id, true);
|
this.$refs.addOrUpdataRef.init(this.deptId, val, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editHoliday() {
|
editHoliday() {
|
||||||
@@ -561,4 +765,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.addDialog {
|
||||||
|
.el-dialog__body {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user