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

V20240923 保存

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