|
|
@ -1,15 +1,22 @@ |
|
|
|
<template> |
|
|
|
<!-- 确认模板 --> |
|
|
|
<div class=''> |
|
|
|
<el-dialog title="模板确认" :visible.sync="showTemplate" width="50%" :close-on-click-modal="false"> |
|
|
|
<div id="luckysheet1" v-if="showTemplate"></div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="handleCancel">取 消</el-button> |
|
|
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-dialog title="模板确认" :visible.sync="showTemplate" width="50%" :close-on-click-modal="false" :modal="false"> |
|
|
|
<div id="luckysheet1" v-if="showTemplate"></div> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="handleCancel">取 消</el-button> |
|
|
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
|
|
|
</span> |
|
|
|
|
|
|
|
<!-- 嵌套的 el-dialog --> |
|
|
|
<el-dialog title="操作提示" :visible.sync="showTips" width="50%" :close-on-click-modal="false" :modal="false"> |
|
|
|
<p style="color: #df3d3d;">目前数据提报模板只支持单行表头,请按下图示例表格修改为单行表头重新上传。</p> |
|
|
|
<img :src="`${require('@/assets/img/tips.jpg')}`" style="width: 90%;" alt=""> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="handleConfirmInnerAndCancel">我知道了</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import LuckyExcel from 'luckyexcel'; |
|
|
@ -17,7 +24,9 @@ import options from "@/utils/luckysheetConfig.js"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return {}; |
|
|
|
return { |
|
|
|
showTips:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { }, |
|
|
|
methods: { |
|
|
@ -67,8 +76,18 @@ export default { |
|
|
|
this.$emit('handelHideTemplate') |
|
|
|
}, |
|
|
|
handleConfirm(){ |
|
|
|
let boolean = this.exportJson.sheets[0].data[1].every(item => !item || !item.v); |
|
|
|
console.log(boolean); |
|
|
|
if(boolean){ |
|
|
|
this.$emit('saveLuckysheetJson',this.exportJson) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.showTips = true |
|
|
|
} |
|
|
|
}, |
|
|
|
handleConfirmInnerAndCancel(){ |
|
|
|
this.showTips = false; |
|
|
|
this.$emit('handelHideTemplate') |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
console.log(this.fileUrl, 'fileUrl===');//测试用'http://localhost:9001/epmet-work-pc/test1.xlsx' |
|
|
@ -76,8 +95,8 @@ export default { |
|
|
|
/^https:\/\/elink-esua-epdc\.oss-cn-qingdao\.aliyuncs\.com/, |
|
|
|
`${location.origin}` |
|
|
|
); |
|
|
|
this.urlToFile(newUrl,this.fileName) |
|
|
|
// this.urlToFile('http://localhost:9001/epmet-work-pc/test1.xlsx',this.fileName) |
|
|
|
// this.urlToFile(newUrl,this.fileName) |
|
|
|
this.urlToFile('http://localhost:9001/epmet-work-pc/test1.xlsx',this.fileName) |
|
|
|
|
|
|
|
}, |
|
|
|
props: { |
|
|
|