|
@@ -3,10 +3,10 @@
|
|
<div class="duty-card">
|
|
<div class="duty-card">
|
|
<div class="duty-header">
|
|
<div class="duty-header">
|
|
<div>提醒事项</div>
|
|
<div>提醒事项</div>
|
|
- <div class="add-text" @click="handleShowAdd('1')">新增事项</div>
|
|
|
|
|
|
+ <div v-if="status==0" class="add-text" @click="handleShowAdd('1')">新增事项</div>
|
|
</div>
|
|
</div>
|
|
<div class="duty-content">
|
|
<div class="duty-content">
|
|
- <div v-for="(item, index) in dutyData.dataList2" :key="index" class="duty-item2">
|
|
|
|
|
|
+ <div v-for="(item, index) in dutyData.remainds" :key="index" class="duty-item2">
|
|
<div class="text1">{{ item.time }}</div>
|
|
<div class="text1">{{ item.time }}</div>
|
|
<div class="text2">{{ item.text }}</div>
|
|
<div class="text2">{{ item.text }}</div>
|
|
</div>
|
|
</div>
|
|
@@ -15,17 +15,18 @@
|
|
<div class="duty-card">
|
|
<div class="duty-card">
|
|
<div class="duty-header">
|
|
<div class="duty-header">
|
|
<div>待办事项</div>
|
|
<div>待办事项</div>
|
|
- <div class="add-text" @click="handleShowAdd('2')">新增事项</div>
|
|
|
|
|
|
+ <div v-if="status==0" class="add-text" @click="handleShowAdd('2')">新增事项</div>
|
|
</div>
|
|
</div>
|
|
<div class="duty-content">
|
|
<div class="duty-content">
|
|
- <div v-for="(item, index) in dutyData.dataList3" :key="index" class="duty-item2">
|
|
|
|
|
|
+ <div v-for="(item, index) in dutyData.todos" :key="index" class="duty-item2">
|
|
<div class="text1">{{ item.time }}</div>
|
|
<div class="text1">{{ item.time }}</div>
|
|
<div class="text2">{{ item.text }}</div>
|
|
<div class="text2">{{ item.text }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="footer">
|
|
<div class="footer">
|
|
- <div class="confirm-btn" @click="handleToShiftChange">确认交班</div>
|
|
|
|
|
|
+ <div v-if="status==0" class="confirm-btn" @click="handleToShiftChange">确认交班</div>
|
|
|
|
+ <div v-if="status==1" class="confirm-btn handover_btn">已交班,交班时间:{{shift_time}}</div>
|
|
</div>
|
|
</div>
|
|
<van-dialog
|
|
<van-dialog
|
|
v-model:show="show"
|
|
v-model:show="show"
|
|
@@ -41,23 +42,31 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="shiftChange">
|
|
<script lang="ts" setup name="shiftChange">
|
|
-import {ref} from "vue";
|
|
|
|
-import {showConfirmDialog} from "vant";
|
|
|
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
|
+import {showConfirmDialog, showFailToast} from "vant";
|
|
|
|
+import {parseTime} from "@/utils/ruoyi";
|
|
|
|
+import { dutyByDay, addDutyNotify, handover } from "@/api/duty/duty";
|
|
|
|
|
|
const emits = defineEmits(['confirm']);
|
|
const emits = defineEmits(['confirm']);
|
|
let show = ref(false);
|
|
let show = ref(false);
|
|
|
|
+const current = ref('');
|
|
|
|
+const status = ref(0);
|
|
|
|
+const shift_time = ref('');
|
|
let eventKey = ref('');
|
|
let eventKey = ref('');
|
|
let content = ref('');
|
|
let content = ref('');
|
|
const dutyData = ref({
|
|
const dutyData = ref({
|
|
- dataList2: [
|
|
|
|
- { text: '台风生成期间,请密切关注台风路径及等级变化情况1。', time: '2024-10-20 11:43:00' },
|
|
|
|
- { text: '台风生成期间,请密切关注台风路径及等级变化情况2。', time: '2024-10-20 11:43:00' },
|
|
|
|
- { text: '台风生成期间,请密切关注台风路径及等级变化情况3。', time: '2024-10-20 11:43:00' }
|
|
|
|
|
|
+ shift_id: 0,
|
|
|
|
+ shift_status: 0,
|
|
|
|
+ handover_time: '',
|
|
|
|
+ remainds: [
|
|
|
|
+ //{ text: '台风生成期间,请密切关注台风路径及等级变化情况1。', time: '2024-10-20 11:43:00' },
|
|
|
|
+ //{ text: '台风生成期间,请密切关注台风路径及等级变化情况2。', time: '2024-10-20 11:43:00' },
|
|
|
|
+ //{ text: '台风生成期间,请密切关注台风路径及等级变化情况3。', time: '2024-10-20 11:43:00' }
|
|
],
|
|
],
|
|
- dataList3: [
|
|
|
|
- { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作1。', time: '2024-10-20 11:43:00' },
|
|
|
|
- { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作2。', time: '2024-10-20 11:43:00' },
|
|
|
|
- { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作3。', time: '2024-10-20 11:43:00' }
|
|
|
|
|
|
+ todos: [
|
|
|
|
+ //{ text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作1。', time: '2024-10-20 11:43:00' },
|
|
|
|
+ //{ text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作2。', time: '2024-10-20 11:43:00' },
|
|
|
|
+ //{ text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作3。', time: '2024-10-20 11:43:00' }
|
|
]
|
|
]
|
|
});
|
|
});
|
|
const handleShowAdd = (key) => {
|
|
const handleShowAdd = (key) => {
|
|
@@ -67,8 +76,14 @@ const handleShowAdd = (key) => {
|
|
const handleToShiftChange = () => {
|
|
const handleToShiftChange = () => {
|
|
showConfirmDialog({
|
|
showConfirmDialog({
|
|
title: '提示',
|
|
title: '提示',
|
|
- message: '是否确认交班',
|
|
|
|
|
|
+ message: '是否确认交班?',
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
+ handover({
|
|
|
|
+ shift_id: dutyData.value.shift_id
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ getDuytData();
|
|
|
|
+ })
|
|
|
|
+
|
|
// on confirm
|
|
// on confirm
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -79,6 +94,18 @@ const handleCancel = () => {
|
|
}
|
|
}
|
|
// 新增
|
|
// 新增
|
|
const handleConfirm = () => {
|
|
const handleConfirm = () => {
|
|
|
|
+ if(content.value == '') {
|
|
|
|
+ showFailToast("请输入事项内容");
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ addDutyNotify({
|
|
|
|
+ shift_id: dutyData.value.shift_id,
|
|
|
|
+ notify_content: content.value,
|
|
|
|
+ notify_type: eventKey.value}
|
|
|
|
+ ).then((res)=>{
|
|
|
|
+ getDuytData();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
// let method = eventKey.value === '1' ? 'method1' : 'method2';
|
|
// let method = eventKey.value === '1' ? 'method1' : 'method2';
|
|
// method().then((res) => {
|
|
// method().then((res) => {
|
|
// show.value = false;
|
|
// show.value = false;
|
|
@@ -86,6 +113,22 @@ const handleConfirm = () => {
|
|
// emits('confirm');
|
|
// emits('confirm');
|
|
// })
|
|
// })
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const getDuytData = () => {
|
|
|
|
+ dutyByDay({day: current.value}).then((res)=>{
|
|
|
|
+ dutyData.value = res.data;
|
|
|
|
+ status.value = dutyData.value.shift_status;
|
|
|
|
+ shift_time.value = dutyData.value.handover_time;
|
|
|
|
+
|
|
|
|
+ show.value = false;
|
|
|
|
+ content.value = '';
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+onMounted(()=>{
|
|
|
|
+ current.value = parseTime(new Date(), '{y}-{m}-{d}');
|
|
|
|
+ getDuytData();
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -166,5 +209,9 @@ const handleConfirm = () => {
|
|
justify-content: center;
|
|
justify-content: center;
|
|
align-items: center;
|
|
align-items: center;
|
|
}
|
|
}
|
|
|
|
+ .handover_btn {
|
|
|
|
+ background: #aaa;
|
|
|
|
+ width:330px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|