Browse Source

bug#1868智能填表,需要支持如图所示多行表头匹配字段的情况

feture-12345
mk 6 months ago
parent
commit
f3718280a9
  1. BIN
      src/assets/img/tips.jpg
  2. 49
      src/views/modules/base/smartExcel/cpts/excel-template-confirmation.vue

BIN
src/assets/img/tips.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

49
src/views/modules/base/smartExcel/cpts/excel-template-confirmation.vue

@ -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: {

Loading…
Cancel
Save