Browse Source

2024-05-15 修改 排班日历-单日排班取消按钮不好用bug ;删除排班日历无效页面

master_hella_20240701
zhousq 7 months ago
parent
commit
fd4c1643fe
  1. 179
      src/views/mes/holidayCalendar/holidayCalendar.data.ts
  2. 75
      src/views/mes/holidayCalendar/index.vue
  3. 8
      src/views/mes/jobcalendar/index.vue
  4. 6
      src/views/mes/workcalendar/index.vue

179
src/views/mes/holidayCalendar/holidayCalendar.data.ts

@ -1,179 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const HolidayCalendarRules = reactive({
endTime: [required],
concurrencyStamp: [required],
})
export const HolidayCalendar = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'ID',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '日期',
field: 'holidayDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '结束时间',
field: 'endTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '备用字段一',
field: 'textOne',
sort: 'custom',
isSearch: true,
},
{
label: '备用字段二',
field: 'textTwo',
sort: 'custom',
isSearch: true,
},
{
label: '备用字段三',
field: 'textThree',
sort: 'custom',
isSearch: true,
},
{
label: '备用字段四',
field: 'textFour',
sort: 'custom',
isSearch: true,
},
{
label: '备用字段五',
field: 'textFive',
sort: 'custom',
isSearch: true,
},
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: true,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

75
src/views/mes/holidayCalendar/index.vue

@ -1,75 +0,0 @@
<template>
<div>
<el-calendar>
<template #date-cell="{ data }">
<div
style="height: 100"
:class="data.isSelected ? 'is-selected' : ''"
@click="handleClick(data.day)"
>
<div>{{ data.day.split('-').slice(1).join('-') }}</div>
<div v-if="arr.find((v) => v.date === data.day)">{{ arr.find((v) => v.date === data.day).content }}
</div>
<!-- <div>{{ data.isSelected ? '打羽毛球' : '' }}</div>  -->
</div>
</template>
</el-calendar>
<!-- 自定义弹出框 -->
<el-dialog v-model="dialogFormVisible" title="日程安排" width="600" draggable="true">
<el-form :model="calendar" :label-width="100">
<el-form-item label="日程内容">
<el-input v-model="calendar.content" autocomplete="off" />
</el-form-item>
<el-form-item label="创建时间">
<el-input v-model="calendar.content" autocomplete="off" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="save"> 确定 </el-button>
<el-button @click="dialogFormVisible = false"> 取消 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
import { reactive, ref } from 'vue'
import { HolidayCalendar, HolidayCalendarRules } from './holidayCalendar.data'
import * as HolidayCalendarApi from '@/api/mes/holidayCalendar'
const dialogTableVisible = ref(false)
const dialogFormVisible = ref(false)
const formLabelWidth = '160px'
export default {
name: 'Calendar',
data() {
return {
value: new Date(),
arr: [
{ date: '2024-04-01', content: '打球' },
{ date: '2024-04-02', content: '打台球' },
{ date: '2024-04-03', content: '打篮球' },
{ date: '2024-04-04', content: '踢足球' }
],
dialogFormVisible:false,
calendar: {}
}
},
methods: {
handleClick(date) {
this.dialogFormVisible = true
this.calendar.date=date
},
save(){
}
}
}
</script>
<style scoped>
</style>

8
src/views/mes/jobcalendar/index.vue

@ -1,8 +0,0 @@
<template>
<el-calendar v-model="value" />
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const value = ref(new Date())
</script>

6
src/views/mes/workcalendar/index.vue

@ -238,7 +238,7 @@
</el-table> </el-table>
</el-form> </el-form>
<div class="demo-drawer__footer"> <div class="demo-drawer__footer">
<el-button @click="handleBatchClose"> </el-button> <el-button @click="handleAddClose"> </el-button>
<el-button type="primary" @click="addWork"> 保存 </el-button> <el-button type="primary" @click="addWork"> 保存 </el-button>
</div> </div>
</div> </div>
@ -661,6 +661,10 @@ const batchAddWork = () => {
const handleBatchClose = () => { const handleBatchClose = () => {
batchAddDrawer.value = false batchAddDrawer.value = false
} }
const handleAddClose = () => {
drawer.value = false
}
const savePlan = async (workList) => { const savePlan = async (workList) => {
await workCalendarApi.createBatch(workList) await workCalendarApi.createBatch(workList)
//await workCalendarApi.createObj(workList); //await workCalendarApi.createObj(workList);

Loading…
Cancel
Save