|
|
@ -59,7 +59,7 @@ |
|
|
|
</el-aside> |
|
|
|
<el-main> |
|
|
|
<div class="calender-class"> |
|
|
|
<el-calendar ref="calendarMain"> |
|
|
|
<el-calendar ref="calendarMain" :key="calendarCount"> |
|
|
|
<template #header="{ date }"> |
|
|
|
<span>排班日历</span> |
|
|
|
<span>{{ date }}</span> |
|
|
@ -151,7 +151,7 @@ |
|
|
|
<el-drawer :title="batchTitle" v-model="batchAddDrawer" size="40%"> |
|
|
|
<div class="demo-drawer_content"> |
|
|
|
<el-form v-model="batchAddForm"> |
|
|
|
<el-form-item label="排班日期:" label-width="120px"> |
|
|
|
<el-form-item label="排班日期:" > |
|
|
|
<el-date-picker |
|
|
|
v-model="batchAddForm.batchDate" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
@ -162,7 +162,7 @@ |
|
|
|
> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="规则类型:" label-width="120px"> |
|
|
|
<el-form-item label="规则类型:" > |
|
|
|
<!-- <el-button type="primary" @click="addDomain" link> <Icon icon="ep:plus" /> </el-button> --> |
|
|
|
<el-radio-group v-model="ruleType" @change="handleRuleType"> |
|
|
|
<el-radio label="一班倒">一班倒</el-radio> |
|
|
@ -170,7 +170,7 @@ |
|
|
|
<el-radio label="三班倒">三班倒</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="排除非法定休息日:" label-width="120px"> |
|
|
|
<el-form-item label="排除非法定休息日:"> |
|
|
|
<el-switch v-model="batchAddForm.excludeRestDay" /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
@ -329,7 +329,7 @@ interface Team { |
|
|
|
name: string |
|
|
|
class: string |
|
|
|
} |
|
|
|
|
|
|
|
const calendarCount=ref(0) |
|
|
|
const currentRow = ref() //当前行的值 |
|
|
|
const handleTableCurrentChange = (val: Team) => { |
|
|
|
currentRow.value = val |
|
|
@ -414,6 +414,12 @@ watch( |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
// watch( |
|
|
|
// () => viewDate.value, |
|
|
|
// (newVal) => { |
|
|
|
// console.log('🚀 ~ file: workcalendar:420 ~ watch ~ viewDate:', newVal) |
|
|
|
// } |
|
|
|
// ) |
|
|
|
onMounted( |
|
|
|
async function () { |
|
|
|
let res=await workCalendarApi.getHolidays(dayjs(currentDate.value).year()) |
|
|
@ -573,9 +579,15 @@ const addWork = () => { |
|
|
|
saveList.push(info) |
|
|
|
|
|
|
|
}) |
|
|
|
//console.log('🚀 ~ file: App.vue:571 ~ addWork ~ saveList:', saveList) |
|
|
|
savePlan(saveList) |
|
|
|
getViewData(currentRow.value.code, hanleDay.value.day, hanleDay.value.day) |
|
|
|
|
|
|
|
savePlan(saveList,currentRow.value.code, hanleDay.value.day.slice(0, 8) + '01', dayjs(hanleDay.value.day).endOf('month').format('YYYY-MM-DD')) |
|
|
|
|
|
|
|
//nextTick(() => { |
|
|
|
//getViewData(currentRow.value.code, hanleDay.value.day.slice(0, 8) + '01', dayjs(hanleDay.value.day).endOf('month').format('YYYY-MM-DD')) |
|
|
|
///}) |
|
|
|
//getViewData(currentRow.value.code, hanleDay.value.day, hanleDay.value.day) |
|
|
|
|
|
|
|
//console.log('🚀 ~ file: App.vue:571 ~ addWork ~ saveList:', dayjs(hanleDay.value.day).endOf('month').format('YYYY-MM-DD')) |
|
|
|
|
|
|
|
drawer.value = false |
|
|
|
} |
|
|
@ -650,8 +662,8 @@ const batchAddWork = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
savePlan(saveList) |
|
|
|
getViewData(currentRow.value.code, dateList[0], dateList[1]) |
|
|
|
savePlan(saveList,currentRow.value.code, dateList[0], dateList[1]) |
|
|
|
//getViewData(currentRow.value.code, dateList[0], dateList[1]) |
|
|
|
batchAddDrawer.value = false |
|
|
|
batchAddForm.value = { |
|
|
|
batchDate: [], |
|
|
@ -665,8 +677,11 @@ const handleAddClose = () => { |
|
|
|
drawer.value = false |
|
|
|
} |
|
|
|
|
|
|
|
const savePlan = async (workList) => { |
|
|
|
const savePlan = async (workList, code,startTime,endTime) => { |
|
|
|
await workCalendarApi.createBatch(workList) |
|
|
|
nextTick(() => { |
|
|
|
getViewData( code,startTime,endTime) |
|
|
|
}) |
|
|
|
//await workCalendarApi.createObj(workList); |
|
|
|
} |
|
|
|
const getViewData = async (teamCode: any, startDate: any, endDate: any) => { |
|
|
@ -676,8 +691,12 @@ const getViewData = async (teamCode: any, startDate: any, endDate: any) => { |
|
|
|
endTime: endDate |
|
|
|
} |
|
|
|
let res = await workCalendarApi.getWorkPlan(params) |
|
|
|
//onsole.log('🚀 ~ file: App.vue:689 ~ getViewData ~ getViewData:',res) |
|
|
|
viewDate.value = res |
|
|
|
calendarCount.value++ |
|
|
|
// }) |
|
|
|
//if(res) |
|
|
|
viewDate.value = res |
|
|
|
|
|
|
|
//workInfoList.value =viewDate.value |
|
|
|
//console.log('🚀 ~ file: App.vue:672 ~ getViewData ~ getViewData:', viewDate.value) |
|
|
|
} |
|
|
@ -726,7 +745,7 @@ const getTeamList = async () => { |
|
|
|
|
|
|
|
//删除班组排班 |
|
|
|
const handleDelete=(row:any)=>{ |
|
|
|
message.delConfirm('确认要删除['+row.name+']班组当月排班数据吗?', 'Warning').then(() => { |
|
|
|
message.delConfirm('确认要删除['+row.name+']班组当月排班数据吗?', '警告').then(() => { |
|
|
|
//console.log('🚀 ~ file: App.vue:720 ~ handleDelete ~ :', dayjs(currentDate.value).endOf('month').format('YYYY-MM-DD')) |
|
|
|
deleteWorkPlan(row.code,currentDate.value.slice(0, 8) + '01', dayjs(currentDate.value).endOf('month').format('YYYY-MM-DD')) |
|
|
|
|
|
|
@ -742,10 +761,11 @@ const deleteWorkPlan=async (code:any,startTime:any,endTime:any)=>{ |
|
|
|
startTime:startTime, |
|
|
|
endTime: endTime |
|
|
|
} |
|
|
|
console.log('🚀 ~ file: App.vue:720 ~ deleteWorkPlan ~ :', data) |
|
|
|
//console.log('🚀 ~ file: App.vue:720 ~ deleteWorkPlan ~ :', data) |
|
|
|
workCalendarApi.deleteWorkPlan(data) |
|
|
|
getViewData(code, startTime,endTime) |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|