Browse Source

值班人员 记录完成

wangqin
Joe 10 months ago
parent
commit
bc9d5db00b
  1. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue
  2. 50
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/OperateRecord.vue
  3. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue

8
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue

@ -254,20 +254,20 @@ export default {
(this.data.dayShift || []).forEach(item => { (this.data.dayShift || []).forEach(item => {
const findIndex = this.dayShift.findIndex(_item => _item.id === item.id); const findIndex = this.dayShift.findIndex(_item => _item.id === item.id);
if (findIndex === -1) deleteIds.push(item.id) if (findIndex === -1) deleteIds.push(item.delId)
}); });
(this.data.graveyardShift || []).forEach(item => { (this.data.graveyardShift || []).forEach(item => {
const findIndex = this.graveyardShift.findIndex(_item => _item.id === item.id); const findIndex = this.graveyardShift.findIndex(_item => _item.id === item.id);
if (findIndex === -1) deleteIds.push(item.id) if (findIndex === -1) deleteIds.push(item.delId)
}) })
Promise.allSettled([ Promise.allSettled([
request({ deleteIds?.length ? request({
url: `/business/shifts/${deleteIds.join()}`, url: `/business/shifts/${deleteIds.join()}`,
method: "DELETE", method: "DELETE",
data: {} data: {}
}), }) : Promise.resolve(),
this.updateData(this.data) this.updateData(this.data)
]) ])
.then(([del, update]) => { .then(([del, update]) => {

50
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/OperateRecord.vue

@ -1,7 +1,9 @@
<template> <template>
<Dialog v-model="visibleModel" title="操作记录"> <Dialog v-model="visibleModel" title="操作记录">
<div class="OperateRecord"> <div class="OperateRecord">
<TimeLine :data="timeLine2List" direction="right" /> <TimeLine v-if="timeLine2List.length" :data="timeLine2List" direction="right" />
<div class="no-data" v-else>暂无操作记录</div>
<div class="bottom"> <div class="bottom">
<Button>确认</Button> <Button>确认</Button>
@ -16,6 +18,8 @@ import Dialog from "@screen/components/Dialog/index.vue";
import TimeLine from "@screen/components/TimeLine/TimeLine2/index.vue"; import TimeLine from "@screen/components/TimeLine/TimeLine2/index.vue";
import Button from "@screen/components/Buttons/Button.vue" import Button from "@screen/components/Buttons/Button.vue"
import request from "@/utils/request";
export default { export default {
name: 'OperateRecord', name: 'OperateRecord',
components: { components: {
@ -27,29 +31,59 @@ export default {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false
},
data: {
type: Object,
default: null
} }
}, },
emit: ['close'], emit: ['close'],
data() { data() {
return { return {
timeLine2List: Array.from({ length: 6 }).map(() => ({ // timeLine2List: Array.from({ length: 6 }).map(() => ({
// title: "", // // title: "",
time: "2023-12-21 16:35:44", // time: "2023-12-21 16:35:44",
name: "甘易玫", // name: "",
desc: "描述性文字文字文字文字文字文字文字文字描述性文字文字文字文字文字文字文字文字", // desc: "",
posts: '淄博发展公司管理员' // posts: ''
})), // })),
timeLine2List: []
} }
}, },
computed: { computed: {
visibleModel: { visibleModel: {
get() { get() {
if (this.visible) this.getData();
return this.visible return this.visible
}, },
set(bool) { set(bool) {
this.$emit('close', bool); this.$emit('close', bool);
} }
} }
},
methods: {
getData() {
request({
url: `/business/shifts/recordList`,
method: "POST",
data: {
date: this.data.date,
station: this.data.station,
}
})
.then(result => {
if (result.code != 200) return Message.error("获取失败");
this.timeLine2List = result.rows.map(item => ({
time: item.operationTime,
name: item.nickName,
desc: item.modifyContent,
posts: "操作员"
}))
})
.catch(() => {
Message.error("获取失败")
})
}
} }
} }
</script> </script>

21
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue

@ -97,7 +97,7 @@
</template> </template>
</SpecialTable> </SpecialTable>
<OperateRecord :visible="operateRecordVisible" @close="handleOperateRecord(false)" /> <OperateRecord :visible="operateRecordVisible" @close="handleOperateRecord(false)" :data="dialogData" />
<ModifyDutyInformationTable :visible="modifyDutyInformationTableVisible" :data="dialogData" <ModifyDutyInformationTable :visible="modifyDutyInformationTableVisible" :data="dialogData"
@close="handleModifyDutyInformationTable(false)" /> @close="handleModifyDutyInformationTable(false)" />
@ -115,7 +115,6 @@ import { searchFormList } from "./data";
import request from "@/utils/request"; import request from "@/utils/request";
import { setLoading } from "@screen/utils/index.js" import { setLoading } from "@screen/utils/index.js"
import { delay, exportFile, confirm } from "@screen/utils/common"; import { delay, exportFile, confirm } from "@screen/utils/common";
import { SchedulingEnum } from "@screen/utils/enum.js"
import { Message } from "element-ui"; import { Message } from "element-ui";
export default { export default {
@ -163,14 +162,19 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
handleOperateRecord(bool) { handleOperateRecord(bool, data) {
this.operateRecordVisible = bool; this.operateRecordVisible = bool;
this.dialogData = data;
}, },
handleModifyDutyInformationTable(bool, data) { handleModifyDutyInformationTable(bool, data) {
if (!bool) this.setCurrentPage(1); if (!bool) this.setCurrentPage(1);
this.modifyDutyInformationTableVisible = bool; this.modifyDutyInformationTableVisible = bool;
this.dialogData = data; this.dialogData = {
...data,
dayShift: (data.dayShift || []).map(item => ({ ...item, delId: item.id, id: item.employeesId })),
graveyardShift: (data.graveyardShift || []).map(item => ({ ...item, id: item.employeesId }))
};
}, },
handleExport() { handleExport() {
exportFile({ exportFile({
@ -239,9 +243,12 @@ export default {
await confirm({ message: "是否要删除该值班信息?" }); await confirm({ message: "是否要删除该值班信息?" });
request({ request({
url: `/business/shifts/${data.id}`, url: `/business/shifts/delete`,
method: "DELETE", method: "POST",
data: {} data: {
date: data.date,
station: data.station,
}
}) })
.then(result => { .then(result => {
if (result.code != 200) return Message.error("删除失败"); if (result.code != 200) return Message.error("删除失败");

Loading…
Cancel
Save