Commit 54e7c590 authored by xinzhedeai's avatar xinzhedeai

西沟 导出日报表

parent 621a3923
......@@ -452,6 +452,8 @@ var reqApis = function () {
rightBtn: [
{
type:'warning', icon:'el-icon-document', name:'导出日报表', 'callback':function(){
this.exportFile()
return
var loading = this.$loading({
lock: true,
text: '请稍后.....',
......
......@@ -59,6 +59,23 @@
:cancel="cancelForm"
:watchKeys="['paperfilename']"
/>
<el-dialog :visible.sync="dialogVisible" width="300px" title="导出日报表" @close="resetDate">
<el-date-picker
v-model="selectedDate"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%;"
/>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="downloadFileDay">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -80,6 +97,10 @@ export default {
},
data() {
return {
// 导入日报表
dialogVisible: false,
selectedDate: null,
refreshInterval: null,
Dict: { selectList: [] },
table: {
......@@ -135,6 +156,35 @@ export default {
this.clearRefreshInterval(); // 清除定时器
},
methods: {
resetDate() {
this.selectedDate = null;
},
downloadFileDay() {
if (!this.selectedDate) {
this.$message.error('请先选择日期');
return;
}
var loading = this.$loading({
lock: true,
text: '请稍后.....',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.pageApi.download1({date: this.selectedDate}).then((res) => {
loading.close();
var name = this.selectedDate + ' GNSS日报表';
Tools.downloadFile(res, name, 'docx')
this.dialogVisible = false; // 关闭弹窗
})
},
exportFile(){
this.dialogVisible = true
this.selectedDate = null
},
// 定时刷新开始
startRefreshInterval() {
this.refreshInterval = setInterval(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment