|
|
|
@ -3,7 +3,12 @@ |
|
|
|
<h3 class="title-small">基本信息</h3> |
|
|
|
<div class="content_box"> |
|
|
|
<div class="left"> |
|
|
|
<el-form :model="form" :rules="rules" ref="importForm" label-width="100px"> |
|
|
|
<el-form |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
ref="importForm" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<el-form-item label="任务类型" prop="importCategory"> |
|
|
|
<el-select |
|
|
|
v-model="form.importCategory" |
|
|
|
@ -28,10 +33,13 @@ |
|
|
|
<span v-if="categoryName">{{ |
|
|
|
this.$store.state.user.agencyName + categoryName || "" |
|
|
|
}}</span> |
|
|
|
<span v-if="categoryName">导入模板.xlsx</span> |
|
|
|
<span v-if="categoryName">导入模板.xlsx</span> |
|
|
|
<span v-else>请先选择任务类型</span> |
|
|
|
<el-button type="text" @click="handelClickDownModule" |
|
|
|
v-if="categoryName">点击下载</el-button |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
@click="handelClickDownModule" |
|
|
|
v-if="categoryName" |
|
|
|
>点击下载</el-button |
|
|
|
></span |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
@ -40,6 +48,7 @@ |
|
|
|
v-model="form.taskName" |
|
|
|
size="small" |
|
|
|
class="u-item-width-normal" |
|
|
|
placeholder="请输入" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
@ -121,6 +130,9 @@ |
|
|
|
width="75%" |
|
|
|
> |
|
|
|
<div v-if="dataList.length > 0" style="height: 600px; overflow-y: scroll"> |
|
|
|
<p style="margin-top: 0px;"> |
|
|
|
说明:系统将会将您上传的表格列自动匹配到平台对应的数据列,匹配错误或没有匹配上的列(红色高亮)您还可以手动匹配 |
|
|
|
</p> |
|
|
|
<el-table |
|
|
|
ref="ref_table" |
|
|
|
:data="dataList" |
|
|
|
@ -139,19 +151,33 @@ |
|
|
|
prop="userTableHeader" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="表格信息" |
|
|
|
label="上传表格列" |
|
|
|
min-width="80" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.userTableHeader || "--" }} |
|
|
|
<span |
|
|
|
:class="[ |
|
|
|
scope.row.itemGroupId && scope.row.itemGroupId != '' |
|
|
|
? '' |
|
|
|
: 'font_color_red', |
|
|
|
]" |
|
|
|
>{{ scope.row.userTableHeader || "--" }}</span |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="对应到" |
|
|
|
min-width="50" |
|
|
|
> |
|
|
|
<template slot-scope="scope"><span v-if="scope.row.itemGroupId"> =></span> </template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="itemGroupId" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="平台对应信息" |
|
|
|
label="平台数据列" |
|
|
|
min-width="110" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -229,7 +255,7 @@ export default { |
|
|
|
dataListLoading: false, |
|
|
|
dataList: [], |
|
|
|
groupList: [], |
|
|
|
fileCode:null, |
|
|
|
fileCode: null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
@ -238,7 +264,7 @@ export default { |
|
|
|
await this.loadPersonGroup(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handelClearCategory(){ |
|
|
|
handelClearCategory() { |
|
|
|
this.categoryName = null; |
|
|
|
}, |
|
|
|
async loadPersonGroup() { |
|
|
|
@ -278,7 +304,6 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handelClickCategory(label) { |
|
|
|
this.categoryName = label; |
|
|
|
@ -340,7 +365,7 @@ export default { |
|
|
|
if (!this.form.importCategory || !this.form.taskName) { |
|
|
|
this.$message.error("请完善基本信息!"); |
|
|
|
this.dataListLoading = false; |
|
|
|
return false |
|
|
|
return false; |
|
|
|
} |
|
|
|
return fileType && isLt1M; |
|
|
|
}, |
|
|
|
@ -436,17 +461,17 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
handelClickUpload() { |
|
|
|
this.$refs["importForm"].validate( (valid) => { |
|
|
|
this.$refs["importForm"].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.saveImportResiHouseExcel() |
|
|
|
this.saveImportResiHouseExcel(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
async saveImportResiHouseExcel(){ |
|
|
|
async saveImportResiHouseExcel() { |
|
|
|
const { fileCode, dataList } = this; |
|
|
|
if(!fileCode){ |
|
|
|
if (!fileCode) { |
|
|
|
this.$message.error("请先上传文件"); |
|
|
|
return |
|
|
|
return; |
|
|
|
} |
|
|
|
let obj = dataList.reduce((acc, item) => { |
|
|
|
if (item.userTableHeader) { |
|
|
|
@ -459,12 +484,14 @@ export default { |
|
|
|
formData.append("fileCode", fileCode); |
|
|
|
formData.append("taskName", this.form.taskName); |
|
|
|
await this.$http |
|
|
|
.post("/actual/base/intelligentImportData/importResiHouseExcel", formData) |
|
|
|
.post( |
|
|
|
"/actual/base/intelligentImportData/importResiHouseExcel", |
|
|
|
formData |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
|
console.log("res-up", res); |
|
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
|
|
|
|
|
this.$emit("handelClickUpload",fileCode); |
|
|
|
this.$emit("handelClickUpload", fileCode); |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
|