|
|
@ -1,12 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- :style="{ height: tableHeight }" --> |
|
|
<!-- :style="{ height: tableHeight }" --> |
|
|
<div class='flex el-card'> |
|
|
<div class='flex'> |
|
|
<div class="left_menu flex flex-y" v-if="!sheetTotal"> |
|
|
<div class="left_menu flex flex-y" v-if="!sheetTotal"> |
|
|
<el-button type="text" round @click="handelClickBack" icon="el-icon-back">返回</el-button> |
|
|
<el-button type="text" round @click="handelClickBack" icon="el-icon-back">返回</el-button> |
|
|
<section > |
|
|
<section > |
|
|
<div :class="{ 'menu_item': true, 'active': menuActive === index }" v-for="(item, index) in menuList" :key="index" |
|
|
<h3>{{menuList[0].taskTitle}}</h3> |
|
|
@click="handleClickMenu(index,item)"> |
|
|
<p>{{menuList[0].agencyName}}</p> |
|
|
<span>{{ item.name }}</span> |
|
|
</section> |
|
|
|
|
|
<section> |
|
|
|
|
|
<div :class="{ 'menu_item': true, 'active': menuActive === index }" v-for="(item, index) in menuList" |
|
|
|
|
|
:key="index" @click="handleClickMenu(index, item)"> |
|
|
|
|
|
<span>第{{ item.taskNum }}个周期提交</span> |
|
|
<i class="el-icon-arrow-right"></i> |
|
|
<i class="el-icon-arrow-right"></i> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
</section> |
|
|
@ -15,7 +19,8 @@ |
|
|
<div class="top_btn flex flex-end"> |
|
|
<div class="top_btn flex flex-end"> |
|
|
<div> |
|
|
<div> |
|
|
<el-button type="warning" v-if="pageType === 'add'" @click="handleClickInspect"> 自动检查</el-button> |
|
|
<el-button type="warning" v-if="pageType === 'add'" @click="handleClickInspect"> 自动检查</el-button> |
|
|
<el-button type="text" round @click="handelClickBack" v-if="pageType !== 'add' || sheetTotal" icon="el-icon-back">返回</el-button> |
|
|
<el-button type="text" round @click="handelClickBack" v-if="pageType !== 'add' || sheetTotal" |
|
|
|
|
|
icon="el-icon-back">返回</el-button> |
|
|
<el-button type="success" @click="onClickUplond()" v-if="pageType !== 'add'"> 智能填表</el-button> |
|
|
<el-button type="success" @click="onClickUplond()" v-if="pageType !== 'add'"> 智能填表</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
<div> |
|
|
@ -26,8 +31,10 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div id="luckysheet"></div> |
|
|
<div id="luckysheet"></div> |
|
|
</div> |
|
|
</div> |
|
|
<el-dialog title="上传共享数据" v-if="showUploadData" :visible.sync="showUploadData" width="60%" :close-on-click-modal="false"> |
|
|
<el-dialog title="上传共享数据" v-if="showUploadData" :visible.sync="showUploadData" width="60%" |
|
|
<excelUploadData @handelUploadData="handelUploadData" :currentTable="currentTable" @saveUploadForm="saveUploadForm"> |
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
<excelUploadData @handelUploadData="handelUploadData" :currentTable="currentTable" |
|
|
|
|
|
@saveUploadForm="saveUploadForm"> |
|
|
</excelUploadData> |
|
|
</excelUploadData> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
@ -45,24 +52,24 @@ export default { |
|
|
return { |
|
|
return { |
|
|
showUploadData: false, |
|
|
showUploadData: false, |
|
|
menuList: [ |
|
|
menuList: [ |
|
|
{ |
|
|
// { |
|
|
name: '2024年11月第三周(已提交)', |
|
|
// name: '2024年11月第三周(已提交)', |
|
|
workbookId:'1876569275607785473' |
|
|
// workbookId:'1876569275607785473' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
name: '2024年11月第三周(已提交)', |
|
|
// name: '2024年11月第三周(已提交)', |
|
|
workbookId:'1876571135966158850' |
|
|
// workbookId:'1876571135966158850' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
name: '2024年11月第三周(已提交)', |
|
|
// name: '2024年11月第三周(已提交)', |
|
|
workbookId:'1879063358107648002' |
|
|
// workbookId:'1879063358107648002' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
name: '2024年11月第三周(已提交)' |
|
|
// name: '2024年11月第三周(已提交)' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
name: '2024年11月第三周(已提交)' |
|
|
// name: '2024年11月第三周(已提交)' |
|
|
} |
|
|
// } |
|
|
], |
|
|
], |
|
|
menuActive: 0, |
|
|
menuActive: 0, |
|
|
socket: null, |
|
|
socket: null, |
|
|
@ -94,17 +101,28 @@ export default { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
watch: {}, |
|
|
watch: {}, |
|
|
mounted() { |
|
|
async mounted() { |
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.sheetTotal) { |
|
|
if (this.sheetTotal) { |
|
|
this.currentId = '1879063358107648002' |
|
|
this.currentId = this.workbookId; |
|
|
|
|
|
this.loadWorkBook() |
|
|
} else { |
|
|
} else { |
|
|
this.currentId = '1879729047646941185' |
|
|
this.getTaskList() |
|
|
} |
|
|
} |
|
|
this.loadWorkBook() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
async getTaskList() { |
|
|
|
|
|
let parm = { |
|
|
|
|
|
taskId: this.workbookId,//注:此处实际为任务Id只是没必要再声明另外一个参数了 |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
pageSize: 1000 |
|
|
|
|
|
} |
|
|
|
|
|
let { data, code, msg } = await requestGet('/actual/base/communityOneTablePeriodPublish/myPageList', parm) |
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
this.menuList = data.list; |
|
|
|
|
|
this.currentId = this.menuList[0].subWorkBookId |
|
|
|
|
|
this.loadWorkBook() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
async saveUploadForm(val) { |
|
|
async saveUploadForm(val) { |
|
|
const url = '/actual/base/residentBaseInfo/exportOneSheet' |
|
|
const url = '/actual/base/residentBaseInfo/exportOneSheet' |
|
|
const { data, code, msg } = await requestPost(url, val) |
|
|
const { data, code, msg } = await requestPost(url, val) |
|
|
@ -123,13 +141,16 @@ export default { |
|
|
console.log(JSON.stringify(list));//接口入参 |
|
|
console.log(JSON.stringify(list));//接口入参 |
|
|
// 返参示例 |
|
|
// 返参示例 |
|
|
let arr = [ |
|
|
let arr = [ |
|
|
{r:3, |
|
|
{ |
|
|
|
|
|
r: 3, |
|
|
c: 3 |
|
|
c: 3 |
|
|
}, |
|
|
}, |
|
|
{r:4, |
|
|
{ |
|
|
|
|
|
r: 4, |
|
|
c: 4, |
|
|
c: 4, |
|
|
}, |
|
|
}, |
|
|
{r:5, |
|
|
{ |
|
|
|
|
|
r: 5, |
|
|
c: 5, |
|
|
c: 5, |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
@ -182,47 +203,10 @@ export default { |
|
|
}, |
|
|
}, |
|
|
handleClickMenu(i, val) { |
|
|
handleClickMenu(i, val) { |
|
|
this.menuActive = i; |
|
|
this.menuActive = i; |
|
|
this.currentId = val.workbookId; |
|
|
this.currentId = val.subWorkBookId; |
|
|
this.loadWorkBook() |
|
|
this.loadWorkBook() |
|
|
}, |
|
|
}, |
|
|
loadExcel() { |
|
|
|
|
|
var url = 'http://localhost:9001/epmet-work-pc/test.xlsx' |
|
|
|
|
|
|
|
|
|
|
|
var that = this |
|
|
|
|
|
fetch(url).then(response => response.blob()) // 将响应转换为Blob |
|
|
|
|
|
.then(blob => { |
|
|
|
|
|
const fileName = 'test.xlsx'; |
|
|
|
|
|
const file = new File([blob], fileName, { type: 'excel/xlsx' }); |
|
|
|
|
|
var files = []; |
|
|
|
|
|
files.push(file); |
|
|
|
|
|
that.uploadExcel(files); |
|
|
|
|
|
}).catch(error => console.error('Error fetching file:', error)); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uploadExcel(files) { |
|
|
|
|
|
if (files == null || files.length == 0) return alert('没有文件等待导入'); |
|
|
|
|
|
let name = files[0].name; |
|
|
|
|
|
let suffixArr = name.split('.'), |
|
|
|
|
|
suffix = suffixArr[suffixArr.length - 1]; |
|
|
|
|
|
if (suffix != 'xlsx') return alert('目前只支持导入xlsx文件'); |
|
|
|
|
|
LuckyExcel.transformExcelToLucky(files[0], function (exportJson, luckysheetfile) { |
|
|
|
|
|
console.log(exportJson.sheets); |
|
|
|
|
|
if (exportJson.sheets == null || exportJson.sheets.length == 0) return alert('读取excel文件内容失败, 目前不支持XLS文件!'); |
|
|
|
|
|
window.luckysheet.destroy(); |
|
|
|
|
|
window.luckysheet.create({ |
|
|
|
|
|
...options, |
|
|
|
|
|
data: exportJson.sheets[0], |
|
|
|
|
|
title: exportJson.info.name, |
|
|
|
|
|
hook: { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
handleTabClick(tab, event) { |
|
|
|
|
|
console.log(tab, event); |
|
|
|
|
|
}, |
|
|
|
|
|
handelClickBack() { |
|
|
handelClickBack() { |
|
|
this.$emit('close') |
|
|
this.$emit('close') |
|
|
}, |
|
|
}, |
|
|
@ -306,6 +290,7 @@ export default { |
|
|
width: calc(100vw - 400px); |
|
|
width: calc(100vw - 400px); |
|
|
height: calc(100vh - 250px); |
|
|
height: calc(100vh - 250px); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.luckysheet-wrap-all { |
|
|
.luckysheet-wrap-all { |
|
|
margin: 10px; |
|
|
margin: 10px; |
|
|
padding: 0px; |
|
|
padding: 0px; |
|
|
@ -313,6 +298,7 @@ export default { |
|
|
width: calc(100vw - 100px); |
|
|
width: calc(100vw - 100px); |
|
|
height: calc(100vh - 250px); |
|
|
height: calc(100vh - 250px); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#luckysheet { |
|
|
#luckysheet { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
padding: 0px; |
|
|
padding: 0px; |
|
|
|