Browse Source

智能填表兼容智能报表模块使用

luckysheet_xiaowang
mk 6 months ago
parent
commit
a3b010c5fb
  1. 37
      src/views/modules/base/smartExcel/cpts/excel-upload-data.vue

37
src/views/modules/base/smartExcel/cpts/excel-upload-data.vue

@ -9,6 +9,14 @@
</el-steps> </el-steps>
</div> </div>
<div v-show="progress == 1" style="width: 80%; margin-top: 10px; font-size: 16px;"> <div v-show="progress == 1" style="width: 80%; margin-top: 10px; font-size: 16px;">
<el-form :model="formData" :rules="rules" ref="ref_form" :label-width="'120px'" v-if="pageType === 'report'">
<el-form-item label="标题名称" prop="reportName">
<el-input v-model.trim="formData.reportName" size="small" clearable style=" height: 40px;"
placeholder="请输入">
</el-input>
</el-form-item>
</el-form>
<div class="flex" style="margin: 60px 0;"> <div class="flex" style="margin: 60px 0;">
<div @click="onClickTab(item)" class="flex" <div @click="onClickTab(item)" class="flex"
style=" cursor: pointer; position: relative;display: flex; flex-direction: column; align-items: center; justify-content: center; width: 155px;height: 90px;background: #F1F4FA;border-radius: 4px; margin-left: 60px;" style=" cursor: pointer; position: relative;display: flex; flex-direction: column; align-items: center; justify-content: center; width: 155px;height: 90px;background: #F1F4FA;border-radius: 4px; margin-left: 60px;"
@ -130,17 +138,20 @@ export default {
// status:0 // status:0
// }, // },
], ],
rules:{
reportName:[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
},
formData: { formData: {
columnMateJson: '', columnMateJson: '',
searchForm: {}, searchForm: {},
formCode:'' formCode:'',
reportName:''
}, },
resident_category_import_list: [], resident_category_import_list: [],
groupList: [], groupList: [],
fileCode: null, fileCode: null,
dataList: [], dataList: [],
dataListLoading:false, dataListLoading:false,
reportForm:[],//2
}; };
}, },
props: { props: {
@ -188,8 +199,16 @@ export default {
}, },
onClickNext() { onClickNext() {
if (this.progress === 1) { if (this.progress === 1) {
this.progress = 2; if(this.pageType == 'report'){
if(this.pageType === 'excel'){ this.$refs['ref_form'].validate((valid)=>{
if (!valid) {
return false
}else{
this.progress = 2;
}
})
}else{
this.progress = 2;
this.dataListLoading = true; this.dataListLoading = true;
this.checkExtractExcelHead() this.checkExtractExcelHead()
} }
@ -210,7 +229,7 @@ export default {
this.formData.searchForm= this.$refs['house_form'].form; this.formData.searchForm= this.$refs['house_form'].form;
} }
if(this.pageType === 'report'){ if(this.pageType === 'report'){
this.reportForm = this.$refs['report_form'].rightList.map(item => { this.formData.columnsJson = this.$refs['report_form'].rightList.map(item => {
return { return {
itemId: item.id, itemId: item.id,
label: item.label, label: item.label,
@ -219,12 +238,18 @@ export default {
supportAdd: item.supportAdd supportAdd: item.supportAdd
} }
}) })
this.formData.reportType = 0;
this.formData.formCode = this.formData1.importCategory === 'BASEINFO'?'resident_base_info':'community_info'
delete this.formData.columnMateJson
}else{
this.formData.formCode = this.formData1.importCategory
delete this.formData.reportName
} }
this.saveUploadForm() this.saveUploadForm()
} }
}, },
async saveUploadForm() { async saveUploadForm() {
const url = '/actual/base/residentBaseInfo/exportOneSheet' const url = this.pageType === 'report'?'/actual/base/intellgentizeReport/create':'/actual/base/residentBaseInfo/exportOneSheet'
const { data, code, msg } = await requestPost(url, this.formData) const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) { if (code === 0) {
this.dataListLoading = false; this.dataListLoading = false;

Loading…
Cancel
Save