提交 c3fbdad6 编写于 作者: 刘英杰's avatar 刘英杰

V20240923 保存

上级 0fdfbe21
...@@ -5,13 +5,12 @@ ...@@ -5,13 +5,12 @@
<Spin v-if="loading" fix></Spin> <Spin v-if="loading" fix></Spin>
<!-- 表标题 --> <!-- 表标题 -->
<div class="table-heard"> <div class="table-heard">
<div > <div>
<Tag size='large'>{{ <Tag size='large'>{{
this.currentWeekRange[0] + '至' + this.currentWeekRange[1] this.currentWeekRange[0] + '至' + this.currentWeekRange[1]
}} }}
</Tag> </Tag>
</div> </div>
<div class="center"> <div class="center">
<Button size="default" @click="weekPre"> <Button size="default" @click="weekPre">
<Icon type="ios-arrow-back"/> <Icon type="ios-arrow-back"/>
...@@ -27,10 +26,12 @@ ...@@ -27,10 +26,12 @@
</div> </div>
</div> </div>
<div style="width: 100%;display: flex;"> <div style="width: 100%;display: flex;">
<Button style="margin:0 5px 0 0;" icon="ios-download-outline" @click="importDuty.show = true">导出值班日志</Button> <Button icon="ios-download-outline" style="margin:0 5px 0 0;" @click="importDuty.show = true">导出值班日志
<Button style="margin:0 5px;" icon="ios-download-outline" @click="importDutySheet.show = true">导出值班表</Button> </Button>
<Upload style="margin:0 5px;" action="#" :before-upload="uploadFile"> <Button icon="ios-download-outline" style="margin:0 5px;" @click="importDutySheet.show = true">导出值班表
<Button icon="ios-cloud-upload-outline">导入值班表</Button> </Button>
<Upload :before-upload="uploadFile" action="#" style="margin:0 5px;">
<Button icon="ios-cloud-upload-outline">导入值班表</Button>
</Upload> </Upload>
</div> </div>
<table align="center" cellpadding="0" cellspacing="0"> <table align="center" cellpadding="0" cellspacing="0">
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
</tr> </tr>
</table> </table>
</Card> </Card>
<!-- 值班安排 --> <!-- 值班安排 -->
<Modal v-model="showModal" :loading='modalLoading' class="add-modal" title="值班安排" width="50%" <Modal v-model="showModal" :loading='modalLoading' class="add-modal" title="值班安排" width="50%"
@on-ok="handleConfirm" @on-cancel='handleClose'> @on-ok="handleConfirm" @on-cancel='handleClose'>
<Form ref="form" :label-width="150" :model="formData" :rules="formRule"> <Form ref="form" :label-width="150" :model="formData" :rules="formRule">
...@@ -113,14 +114,16 @@ ...@@ -113,14 +114,16 @@
</p> </p>
</template> </template>
<div style="text-align:center"> <div style="text-align:center">
<Form :label-width="80" > <Form :label-width="80">
<FormItem label="值班日期" prop="user"> <FormItem label="值班日期" prop="user">
<DatePicker v-model="importDuty.date" style="width: 100%" type="daterange" placement="bottom-end" placeholder="请选择值班日期" /> <DatePicker v-model="importDuty.date" placeholder="请选择值班日期" placement="bottom-end" style="width: 100%"
type="daterange"/>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<template #footer> <template #footer>
<Button type="primary" size="large" :loading="importDuty.loading" long @click="importDutyFun">导出值班日志</Button> <Button :loading="importDuty.loading" long size="large" type="primary" @click="importDutyFun">导出值班日志
</Button>
</template> </template>
</Modal> </Modal>
...@@ -134,14 +137,17 @@ ...@@ -134,14 +137,17 @@
</p> </p>
</template> </template>
<div style="text-align:center"> <div style="text-align:center">
<Form :label-width="80" > <Form :label-width="80">
<FormItem label="值班日期" prop="user"> <FormItem label="值班日期" prop="user">
<DatePicker v-model="importDutySheet.date" style="width: 100%" type="daterange" placement="bottom-end" placeholder="请选择值班日期" /> <DatePicker v-model="importDutySheet.date" placeholder="请选择值班日期" placement="bottom-end" style="width: 100%"
type="daterange"/>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<template #footer> <template #footer>
<Button type="primary" size="large" :loading="importDutySheet.loading" long @click="importDutySheetFun">导出值班表</Button> <Button :loading="importDutySheet.loading" long size="large" type="primary" @click="importDutySheetFun">
导出值班表
</Button>
</template> </template>
</Modal> </Modal>
</div> </div>
...@@ -149,27 +155,28 @@ ...@@ -149,27 +155,28 @@
<script> <script>
import {GetDutyArrangeByDateList, GetPersonByCondiction, DutyArrangeIns} from "@/api/arrangement" import {GetDutyArrangeByDateList, GetPersonByCondiction, DutyArrangeIns} from "@/api/arrangement"
import * as hooks from '@/hook/index' import * as hooks from '@/hook/index'
import * as api from '@/api/controller/index' import * as api from '@/api/controller/index'
import dayjs from "dayjs"; import dayjs from "dayjs";
import {blobFileDown} from "@/hook/index"; import {blobFileDown} from "@/hook/index";
export default { export default {
props: {}, props: {},
data() { data() {
return { return {
importDutySheet: { importDutySheet: {
loading:false, loading: false,
show: false, show: false,
date:[dayjs().format('YYYY-MM-DD'),dayjs().format('YYYY-MM-DD')], date: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
formData: { formData: {
begin_time: '', begin_time: '',
end_time: '' end_time: ''
} }
}, },
importDuty: { importDuty: {
loading:false, loading: false,
show: false, show: false,
date:[dayjs().format('YYYY-MM-DD'),dayjs().format('YYYY-MM-DD')], date: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
formData: { formData: {
begin_time: '', begin_time: '',
end_time: '' end_time: ''
...@@ -231,41 +238,41 @@ export default { ...@@ -231,41 +238,41 @@ export default {
this.GetPersonByCondiction(); this.GetPersonByCondiction();
}, },
methods: { methods: {
uploadFile(file){ uploadFile(file) {
//值班表导入 //值班表导入
let fd = new FormData() let fd = new FormData()
fd.append('file', file) fd.append('file', file)
return api.postApiDutyRecordImportDutyTable(fd).then(res=>{ return api.postApiDutyRecordImportDutyTable(fd).then(res => {
this.$Message.success('导入成功') this.$Message.success('导入成功')
}) })
return false return false
}, },
importDutySheetFun(){ importDutySheetFun() {
//值班表导出 //值班表导出
this.importDutySheet.loading =true this.importDutySheet.loading = true
this.importDutySheet.formData = { this.importDutySheet.formData = {
begin: dayjs(this.importDutySheet.date[0]).format('YYYY-MM-DD'), begin: dayjs(this.importDutySheet.date[0]).format('YYYY-MM-DD'),
end: dayjs(this.importDutySheet.date[1]).format('YYYY-MM-DD'), end: dayjs(this.importDutySheet.date[1]).format('YYYY-MM-DD'),
} }
return api.getApiDutyRecordExportDutyTable(this.importDutySheet.formData).then(res=>{ return api.getApiDutyRecordExportDutyTable(this.importDutySheet.formData).then(res => {
if (res)window.location.href = res if (res) window.location.href = res
this.importDutySheet.loading =false this.importDutySheet.loading = false
}).finally(()=>{ }).finally(() => {
this.importDutySheet.loading =false this.importDutySheet.loading = false
}) })
}, },
importDutyFun(){ importDutyFun() {
//值班附件导出 //值班附件导出
this.importDuty.loading =true this.importDuty.loading = true
this.importDuty.formData = { this.importDuty.formData = {
begin_time: dayjs(this.importDuty.date[0]).format('YYYY-MM-DD'), begin_time: dayjs(this.importDuty.date[0]).format('YYYY-MM-DD'),
end_time: dayjs(this.importDuty.date[1]).format('YYYY-MM-DD'), end_time: dayjs(this.importDuty.date[1]).format('YYYY-MM-DD'),
} }
return api.getApiDutyRecordDutyRecordAllExportByAdmin(this.importDuty.formData,{responseType:'blob'}).then(res=>{ return api.getApiDutyRecordDutyRecordAllExportByAdmin(this.importDuty.formData, {responseType: 'blob'}).then(res => {
hooks.blobFileDown(res,`${this.importDuty.formData.begin_time+'至'+this.importDuty.formData.end_time}值班数据`) hooks.blobFileDown(res, `${this.importDuty.formData.begin_time + '至' + this.importDuty.formData.end_time}值班数据`)
this.importDuty.loading =false this.importDuty.loading = false
}).finally(()=>{ }).finally(() => {
this.importDuty.loading =false this.importDuty.loading = false
}) })
}, },
getData() { getData() {
...@@ -283,7 +290,6 @@ export default { ...@@ -283,7 +290,6 @@ export default {
this.timeGround.push({id: item.duty_type_id, typeName: item.duty_type_name}); this.timeGround.push({id: item.duty_type_id, typeName: item.duty_type_name});
}); });
}) })
}, },
formatDate(year, month, day) { formatDate(year, month, day) {
const y = year; const y = year;
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或